Page 1 of 1

Clear test data from Compiere

PostPosted: Sun Jan 30, 2005 4:52 pm
by andrey
I want to share a code that has proved very useful for us. When one begin to fiddle with Compiere and enter sample test data, he or she may often find in position when things go messy and start over is needed. But in Compiere it is not easy to delete data: especially transactions and accounting data.

So here I present you with the current version of our ClearData process, that erases all the transactional data (orders, financial and material storage data) from Compiere's current client, and let you start over. You do not lose any static data - like business partners, products, etc. With this process you can easily start over testing. But it is highly recommended not to use this process on production environment!

Here you are:

Some installation hints: inside the archive you'll find 2 java classes. To run it you'll probably need to change their package names (we use custom build schema, as we have a lot of addons which we keep outside compiere source). The easiest way is to put them into Compiere's "base" project. Then you shall rebuild Compiere. After that start up compiere, log-in as System and add (from "Report & Process") a new process using ClearData class. Then add a Menu item and restart the Compiere client.

Use it at your own risk! I do not guarantee that it will always work, as we have come to it in an empiric way, and from time to time we use to add some more tables for deletion. Nevertheless it works for us. Hope some of you may find it useful.


PostPosted: Sun Jan 30, 2005 10:38 pm
by red1
Hi Andrey,
This sounds really useful. I m sure many will enjoy what u contributed. On behalf of them, I heartily thank you. 8)

many regards,

Where to download the file ?

PostPosted: Sat Oct 14, 2006 11:06 am
by eric100
The URL to download this file "ClearData.rar" is no longer available.
I really need this file as i want to reset test data from compiere and i find it difficult to do manually.
Could anyone give the updted URL for downloading it ?


PostPosted: Sun Oct 15, 2006 2:27 am
by andrey

it's been long time since I worked on compiere, meanwhile we have changed our company site... Now ClearData source (which was developed at the time of Compiere 251.x) is available for download from this location. I haven't tried it on newer distributions... and it needs some integration with Compiere to get it to work. But it hope that this source will be useful.


Delete transaction data

PostPosted: Sun Oct 15, 2006 4:11 am
by eric100
Hi, the code and the idea behind are very good, i have just tried it on 253b but in vain.
I have to dig more..
what am trying to do is to delete test data and migrate customization from an instance to an other.

Anyway thanks a lot for your reply.

PostPosted: Wed Oct 18, 2006 8:17 pm
by andrey
My code is very simple and just removes the data from some of the tables of Compiere. It does not cope with migration at all. A fellow member (Trifon) of this forum has some solution for migration of some of the customization data - but you'll have to look at it to see if it works for you.

Removing testing data

PostPosted: Thu Oct 19, 2006 4:45 am
by eric100
I have found a similar sql scrpit of what you have given wrote by pshen but it has to be adapted for 253b as the database has evolved.
I tested th 2 pack solution without any problem for creationg packages and exporting them (packOut), but the problem is in importing (packIn).
there ares some issues.
now am examinating the trifon solution and testing it.
I tried with taod but...
with the import and restoredb scripts given by compiere some customised windows have some fields that do not recognize their colum db fields even if the exists in database and compiere tables
i think i will finish by trying to create an sql scrip or an xml tool for that if i can