Migrate > Migrating WebSphere Commerce > Migrating the WebSphere Commerce Server using the command line > wcim_ant utility (database migration script)



Extend the data migration script

Changes to special tables in previous versions of WebSphere Commerce requires you to alter the data migration script prior to migrating the database.


Procedure

  1. Navigate to:

    • WC_INSTALL/schema/migration/xx/database_type

    • Windows WC_INSTALL\schema\migration\xx\database_type

      Where:

    • xx is either 561 or 60.

    • database_type is:

      • DB2 db2

      • Oracle oracle

      • Apache Derby db2\cloudscape

      • For IBM i OS operating system db2\os400

  2. Open the recreate.tables.txt file.

  3. Check if you have modified any of the tables listed in the file. If you haven't modified any of the tables in the file, you can skip the remainder of this task. If you have, continue with the remaining steps in this task.

    The example used in the remaining steps assumes you have a custom column called EXAMPLECOLUMN which has been added to the CATENTRYATTR table as INTEGER DEFAULT 0, and has a foreign key to the MBRGRP table.

  4. Locate the wcs.schema.recreate.tables.sql script file.

  5. Modify the script file by adding the following SQL statement at the end of the file:

    • For IBM i OS operating systemDB2Apache Derby alter table catentryattr add column examplecolumn integer default 0;

    • Oracle alter table catentryattr add examplecolumn integer default 0 null;

  6. Save the updated wcs.schema.recreate.tables.sql file.

  7. Navigate to WC_INSTALL/schema/database_type.

  8. Make a copy of the file wcs.referential.sql, in the same directory and rename it to wcs.referential_instance.sql.

  9. Modify the wcs.referential_instance.sql file to add a referential constraint:

    ALTER TABLE CATENTRYATTR ADD CONSTRAINT F_EXAMPLECOLUMN FOREIGN KEY (EXAMPLECOLUMN) REFERENCES MBRGRP ON DELETE CASCADE;
    

  10. Save the file.


+

Search Tips   |   Advanced Search