Search code examples
db2websphere-7websphere-commerce

IBM WCS and DB2 : Want to export all catentries data from one DB and import into another DB


Basically i have two environments, Production and QA. On QA DB, the data is not same as it is on production so my QA team is unable to test it properly. So want to import all catentries/products related data in QA DB from production. I searched a lot but not found any solution regarding this.

May be i need to find all product related tables and export them one by one and then import into dev db but not sure.

Can anyone please guide me regarding this. How i can do this activity with best practices?

I am using DB2


Solution

  • The WebSphere Commerce data model is documented, which will help you identify all related tables. You can then use the DB2 utility db2move to export (and later load) those tables in one shot. For example,

    db2move yourdb export -sn yourschema -tn catentry,catentrel,catentdesc,catentattr
    

    Be sure to list all tables you need, separated by commas with no spaces. You can specify patterns to match table names:

    db2move yourdb export -sn yourschema -tn "catent*,listprice"
    

    db2move will create a file db2move.lst that lists all extracted tables, so you can load all data with:

    db2move yourQAdb load -lo replace
    

    running from the same directory.