This is how we do it
Be very careful doing this as it is very easy with one simple typo to wipe out a whole lot of data.
Before beginning make sure table sharing between test companies matches production companies.
Running the exports (step 5) will lock the table during the dump so it must be run when no users are on the system (including jobs).
1. Run session ttaad4222m000 (count number of records by table) for each production company. Output to a text file.
2. Run baan sql query “logical”. Output to a text file. (this query is specific to us but basically gets a list of logical tables to be able to filter them out of the lists of tables to dump)
3. Using MS Access (or some other method) create a text file for each company with a list of tables that are not a logical table and that contain data. Save the file as XXXseqdump.txt in the E:\baan\bin folder (where XXX = company number). The idea is to only dump tables that contain data and to not dump data that is physically in another company so that the process runs as quickly as possible.
4. From a command prompt on the server change to the E:\baan\bin folder and run the following to override the normal default settings. This will help the process run quicker (per baan support).
5. Run the following command for each company in turn (where XXX = company number).
bdbpre -t"|" -IXXXseqdump.txt -oE:\seq_dumps\XXX –CXXX
6. Run baan session tccom0214m000 (from file/run) in each source company. The directory must match the folder where you dumped the data (see step 5). You must specify all prod company to test company mappings. The field is not big enough to do it all at once so you need to split it in two and run the session twice. The format is prod1>test1;prod2>test2 (separator is semi-colon).
7. Run session ttaad4231m000 to delete all tables in each test company. You will get a report stating that logical tables could not be deleted, this is ok. This makes sure that there is no orphan data in tables that are not populated in the production company.
8. From command prompt run following for each company (where XXX = source/prod company and YYY = target/test company).
bdbpost -t"|" -kmnf -DE:\seq_dumps\XXX -cYYY
9. Run session ttaad4230m000 to create remaining empty tables in each test company.
10. Log in to test company and make sure all is ok.