Migrate the WebSphere Commerce database using the migration script

Running the database migration can be done with a command line. Review this information prior to migrating to ensure that using the command line instead of the migration wizard is the suitable method for your WebSphere Commerce environment.

To migrate the database using the migration script:

  1. Ensure that you have eliminated all items flagged by the database premigration checker and dropped or disabled all custom database constraints. For more information on dropping and disabling custom database constraints, see "Dropping or disabling custom constraints", in the Premigration steps section of the WebSphere Commerce Migration Guide.

  2. AIX|Linux|Solaris|Windows:

    Before migrating the database, ensure that the user who runs the database tier migration script has the authority to access the files in the WC_installdir directory.

    I5/OS|Before running any database tier migration, your WebSphere Commerce instance profile must have *SECOFR authority. To alter this instance profile, run the following command with a user profile that has *SECOFR authority:

    CHGUSRPRF USRPRF(instance) USRCLS(*SECOFR) SPCAUT(*USRCLS)
    
    
    

    Then sign on with this WebSphere Commerce instance profile for database tier migration.

  3. Open a command window and run the database tier migration script:

    The database tier migration script:

    • Does not delete any records from your database.

    • Migrates the CMDREG and VIEWREG tables to the STRUTS configuration file, struts-config-migrate.xml.

    • See Run scripts for database migration before you begin.

    (DB2)

    • AIX|Linux|Solaris|Open a shell prompt window.

    • AIX|Linux|Solaris: Switch to the WAS user ID (for example, wasuser) as follows: su - wasuser

    • Windows: Open a DB2 command window.

    AIX|Linux|Solaris|(Oracle)

    • Switch to the WAS user ID (for example, wasuser): su - wasuser

    I5/OS|Open a QShell window by running theSTRQSH command.

  4. Switch to the one of the following directories:

  5. Run the database tier migration script:

    (DB2)

    • AIX|Linux|
      ./migratedb.sh -dbtype db2 -dbname dbname -dbuser dbuser [-dbpass dbuserpw]
         -from previous_version -instanceName instance
      
      
      

    • migratedb.bat -dbtype db2 -dbname dbname -dbuser dbuser [-dbpass dbuserpw]
         -from previous_version -instanceName instance
      
      
      

    (Oracle)

    • AIX|Linux|
      ./migratedb.sh -dbtype oracle -dbname dbname -dbuser dbuser [-dbpass oraclepw]
         -from previous_version -instanceName instance -hostname host_name
         -port port_number
      
      
      

    • migratedb.bat -dbtype oracle -dbname dbname -dbuser dbuser [-dbpass oraclepw]
         -from previous_version -instanceName instance -hostname hostname
         -port port_number
      
      
      

    I5/OS|

    • Database is on the local system
      migratedb.sh -dbtype os400 -dbname dbname -dbuser dbuser [-dbpass instancepwd]
       -from previous_version -instanceName instance 
      
      
      

    • Database in on a remote system
      migratedb.sh -dbtype os400 -dbname dbname -dbuser dbuser [-dbpass instancepwd]
       -from previous_version -instanceName instance -hostname hostname -remoteDB true
      
      
      

    Where:

    previous_version

    Is your version of WebSphere Commerce you are migrating from for example, 55, 56, or 561.

    1. If you do not supply the database password on the command line, the migration script will prompt you to enter it in when you run it.

    2. For remote database tier migration, use the following parameters:

      serverName

      represents the host name of the machine where your WebSphere Commerce database is located.

      -remoteDB true

      Required only for remote database tier migrations.

    3. The instance user profile must exist on the remote machine.

  6. Check the log file for additional messages or errors, and resolve any errors that are flagged before proceeding.

    1. Access the log file by typing the following path:

      • I5/OS|WC60_userdir/logs/WCIM/instance/migratedbxx_yyyy.mm.dd_hh.mm.ss.log

      • AIX|Linux|Solaris|WC_installdir/logs\WCIM\instance/migratedbxx_yyyy.mm.dd_hh.mm.ss.log

      • Windows: WC_installdir\logs\WCIM\instance\migratedb xx_yyyy.mm.dd_hh.mm.ss.log

        Where xx is either 55, 56, or 561.

    2. Review warnings generated by the database tier migration script and determine if any actions are needed based on those warnings. The actions can be found within the warning. The following list shows the type of warnings to review
      Info : select N.storeent_id, N.interfacename, N.classname,
      N.properties, O.classname, O.properties 
      from cmdreg_new N, cmdreg O
      where N.storeent_id = O.storeent_id and N.interfacename =
      O.interfacename  and (N.classname != O.classname or
      N.properties != O.properties)
      [2006.01.06 15:57:55] Warning: The bootstrap data has changed. 
      Consider replacing data in table cmdreg with data in cmdreg_new
      [2006.01.06 15:57:55] Warning: The row in the cmdreg_new:
      storeent_id = 0, interfacename = 0,classname =
      com.ibm.commerce.usermanagement.commands.UserRegistrationAddCmd,
      properties =
      com.ibm.commerce.usermanagement.commands.UserRegistrationAddUBFCmdImpl
      [2006.01.06 15:57:55] Warning: The row in the cmdreg    :
      storeent_id = 0, interfacename = 0, classname = null, properties =
      com.ibm.commerce.usermanagement.commands.UserRegistrationAddCmdImpl
      [2006.01.06 15:57:55] Warning: The row in the cmdreg_new:
      storeent_id = 0, interfacename = 0, classname =
      com.ibm.commerce.order.calculation.ApplyShippingCmd, properties =
       com.ibm.commerce.order.calculation.ApplyShippingCmdImpl
      [2006.01.06 15:57:55] Warning: The row in the cmdreg    :
      storeent_id = 0, interfacename = 0, classname = null, properties =
      com.ibm.commerce.order.calculation.PromotionEngineApplyShippingCmdImpl
      
      
      

  7. Resolve any errors that are flagged before proceeding.



Notes:

  1. For a summary of the database schema changes between WebSphere Commerce, version 5.5, 5.6, 5.6.1, and WebSphere Commerce, version 6.0, see Migrating from a previous version of WebSphere Commerce.

  2. If database tier migration fails, make sure you have dropped the customized constraints, restore the database, and then try the migration again. Information on dropping customized constraints can be found in "Premigration steps", the WebSphere Commerce Migration Guide.

 

Related tasks


Migrate the WebSphere Commerce database