Migrate > Migrating WebSphere Commerce > Migrating the WebSphere Commerce Server using the command line
Migrate the WebSphere Commerce database using the WCIM migration script
Run 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 the WebSphere Commerce environment.
Before you begin
- Prepare to migrate WebSphere Commerce
- Update the DB2 database configuration
- Run the database pre-migration checker.
The database migration script:
- Does not delete any records from the database.
- Migrates the CMDREG and VIEWREG tables to the STRUTS configuration file, struts-config-migrate.xml.
V5.6: The struts-config-migrate.xml file is created in the WC_INSTALL/logs/WCIM folder.
This file is created during the migration of the database. After the application tier is migrated using the WCIM utility, the struts-config-migrate.xml file is automatically copied into the following folders of the WC_EAR directory:
- CommerceAccelerator.war/WEB-INF
- OrganizationAdministration.war/WEB-INF
- SiteAdministration.war/WEB-INF
- Stores.war/WEB-INF
It is strongly recommended to use the WebSphere Commerce Migration wizard instead of the WCIM migration scripts to reduce the probability of errors. See
- Overview of migrating the WebSphere Commerce database using the Migration wizard
- Overview of migrating the WebSphere Commerce application using the Migration wizard
Notes:
- Run all scripts associated with database migration under the same user ID that you use to start the WebSphere Commerce application server. IBM recommends that you use a non-root user (for example, wasuser). You can switch to the wasuser...
su - wasuser
Procedure
- Ensure that you have eliminated all items flagged by the database pre-migration checker and dropped or disabled all custom database constraints.
- 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_INSTALL directory.
- Open a command window and run the database tier migration script:
- Open a shell prompt window.
- Switch to the WebSphere Application Server user ID (for example, wasuser)... su - wasuser
- Switch to the WebSphere Application Server user ID (for example, wasuser): su - wasuser
- Start a Qshell session.
- Switch to the one of the following directories:
- WC_INSTALL/bin
- WC_INSTALL\bin
- Run the database tier migration script:
./wcim_ant.sh -tier db -action migrate -from previous_version -instanceName instance
wcim_ant.bat -tier db -action migrate -from previous_version -instanceName instanceWhere:
- previous_version
- Is the version of WebSphere Commerce you are migrating from.
The migration script will prompt you to enter the database password when you run it.
Example of running the tier migration script:
./wcim_ant.sh -tier db -action migrate -from 60 -instanceName my_instance Database type? [ db2 ] (cloudscape,db2,os400,oracle,) os400 Remote database? [ false ] (true,false,) false Database name? my_database_name Database user? my_instance Database user password? my_db_password Database server port? 50000 Is this a test run? [ Yes ] (Yes,No,) No Is the database backup completed? [ Yes ] (Yes,No,) Yes Is the database restore completed? [ Yes ] (Yes,No,) Yes
- Check the log file for additional messages or errors, and resolve any errors that are flagged before proceeding. If you get the following message, the migration has completed successfully.
[2009.06.03.07.05.05] INFO: [wcimEchoTask] Finishing ANT for WCIM at June 3 2009 07:05 AM. [2009.06.03.07.05.05] VERBOSE: BUILD SUCCESSFUL [2009.06.03.07.05.05] VERBOSE: Total time: 9 minutes 49 seconds [2009.06.03.07.05.05] INFO: [WCIMANT] <run> WCIM has completed the job(s) successfully.
- Access the log file by typing the following path:
- WC_INSTALL\logs\WCIM\wcim.server.yyyy.mm.dd_hh.mm.ss.log
- WC_INSTALL\logs\WCIM\wcim.server.yyyy.mm.dd_hh.mm.ss.log
- 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:
[2009.09.29.04.15.19] WARNING: [wcimBootstrapDeltaTask] The bootstrap data has changed. Consider replacing data in table cmdreg with data in cmdreg_new. [2009.09.29.04.15.19] WARNING: [wcimBootstrapDeltaTask] The row in thecmdreg_new: storeent_id = 0, interfacename = com.ibm.commerce.usermanagement.commands.UserRegistrationAddCmd, classname = com.ibm.commerce.usermanagement.commands.UserRegistrationAddUBFCmdImpl, properties = null [2009.09.29.04.15.19] WARNING: [wcimBootstrapDeltaTask] The row in thecmdreg : storeent_id = 0, interfacename = com.ibm.commerce.usermanagement.commands.UserRegistrationAddCmd, classname = com.ibm.commerce.usermanagement.commands.UserRegistrationAddCmdImpl, properties = null [2009.09.29.04.15.19] WARNING: [wcimBootstrapDeltaTask] The row in thecmdreg_new: storeent_id = 0, interfacename = com.ibm.commerce.order.calculation.ApplyShippingCmd, classname = com.ibm.commerce.order.calculation.ApplyShippingCmdImpl, properties = null [2009.09.29.04.15.19] WARNING: [wcimBootstrapDeltaTask] The row in thecmdreg : storeent_id = 0, interfacename = com.ibm.commerce.order.calculation.ApplyShippingCmd, classname = com.ibm.commerce.order.calculation.PromotionEngineApplyShippingCmdImpl, properties = null
- Resolve any errors that are flagged before proceeding.
- If the database tier migration fails, make sure you have dropped the customized constraints, restore the database, and then try the migration again.
What to do next
Perform post database migration steps.
Previous topic:
Run the database pre-migration checker
Next topic:
Migrate the application using the WCIM migration script