WebSphere Commerce Developer

Running premigration scripts

Before you run premigration scripts, ensure that you have a backup of the development database.

About this task

Before migrating the database, you need to run a database setup script and a reset stores script. If you are using Cloudscape, you must migrate the database first, before using the database setup script.
Version 5.6Note: The SQL files mentioned in the steps below are part of the Version 7 installation. If your new Version 7 development environment is on a different machine than Version 5.6.1, copy the two SQL files to your Version 5.6.1 machine before running the SQL files.

Procedure

  1. Version 5.6Apache DerbyIf you are migrating from Version 5.6.1.
    1. Copy the WebSphere Commerce Version 5.6.1 database to a different location for example, C:\WCToolkitEE70\db\.
    2. Start Cloudscape.
    3. Navigate to the directory WCDE_installdir\bin in your 5.6.1 environment.
    4. Type ij.
    5. Connect to the copy of the WebSphere Commerce 5.6.1 , for example:
      connect '../WCToolkitEE70/db/database_name';
      where database_name is the name of the database.
    6. To drop your views, enter:
      Run 'WCDE_installdir/schema/migration/561/wcs.drop.view.sql';
    7. Check if all views have been deleted by entering:
      • select viewdefinition from SYS.SYSVIEWS;
    8. To drop the stored procedures, enter:
      Run 'WCDE_installdir/schema/migration/561/db2/cloudscape/wcs.drop.stored.procedure.sql';
    9. Check if all stored procedures have been deleted. Enter:
      select alias from SYS.SYSALIASES WHERE ALIASTYPE='M';
    10. Exit Cloudscape.
    11. From the WCDE_installdir/bin directory, enter:
      toderby.bat database_name
      where:
      database_name
      Location of your current database. For example, WCDE_installdir\db\database_name

      The command upgrades the database. If you do not enter parameters, the toderby command shows the syntax with examples

      .
  2. Use the setdbtype script to set the database type to the database type that you are migrating from:
    1. Navigate to the WCDE_installdir\bin directory in a command line window.
    2. Run the setdbtype command by typing the following command:
      Note: Ensure the database exists prior to running setdbtype.
      DB2
      setdbtype db2 DB2_HOME dbName dbAdminID dbAdminPassword dbUserID dbUserPassword [dbHost dbServerPort dbNode]
      For IBM i OS operating system
      setdbtype iseries dbName dbHost dbUserID dbUserPassword [createdb] 
      Oracle
      setdbtype oracle ORACLE_HOME dbName dbAdminID dbAdminPassword dbUserID dbUserPassword [dbHost dbServerPort] 
      Apache Derby
      setdbtype cloudscape
      Where:
      DB2_HOME
      The root directory of DB2 on your system (for example, c:\IBM\SQLLIB).
      ORACLE_HOME
      The root directory of the Oracle DBMS on your system (for example, C:\oracle\product\11.1.0\client_1 ).
      For IBM i OS operating systemiseries
      For IBM i OS operating systemType exactly as shown, iseries.
      dbName
      The name of the database (for example, mall).
      dbAdminID
      The database administrator's ID (for example, db2admin, or oracle).
      For IBM i OS operating systemcreatedb
      For IBM i OS operating systemOptional: Creates a database. Type exactly as shown, createdb.
  3. To reset the stores, enter:
    WCDE_installdir/bin/resetstores.bat
    Running this command ensures that any published stores will run correctly after migration.