Migrate > Take the first steps after WebSphere Commerce migration > Migrating promotions
Migrate promotions built on default promotion types: complete migration
For this type of migration, typically, you run the promotion migration utility using the default configuration files and XSL templates; however, in a certain case, create a custom Config Info configuration file to specify an option that is not the default setting.
Before you begin
Read the following topics:
Procedure
- Based on the information you read in the topic Migration limitation for certain order-level promotions, choose one of the following options to deal with promotions with the exclusivity option "Cannot be combined with product promotions":
- If you have no promotions with this exclusivity option, or if to perform a partial migration on those promotions, go to step 3.
- To perform a complete migration or no migration on promotions with this exclusivity option, go to the next step.
- Create a custom version of the Control Info configuration file (promotionMigrationControlInfo.xml) to specify the migration option for promotions with this exclusivity option:
- Navigate to the WC_INSTALL/migration/optional/components/component-services/subcomponents/promotion/config/ directory.
- Copy the promotionMigrationControlInfo.xml file and rename the copy; this creates the custom Control Info configuration file. Do not change the default promotionMigrationControlInfo.xml file.
- Open the custom Control Info configuration file.
- Choose one of the following options:
- To specify a complete migration for promotions with this exclusivity option, locate the following lines of code near the top of the file and replace Partial with Complete:
<PromotionExclusivityCannotCombineWithProductPromotionsMigrationType> Partial </PromotionExclusivityCannotCombineWithProductPromotionsMigrationType>
- To stop promotions with this exclusivity option from being migrated, delete the following lines of code from the file:
<PromotionExclusivityCannotCombineWithProductPromotionsMigrationType> Partial </PromotionExclusivityCannotCombineWithProductPromotionsMigrationType>
When you run the promotion migration utility after removing these lines of code, the utility will display an error message telling you the lines of code are missing. You can ignore this message.
- Save and close the custom Control Info configuration file.
- Stop the WebSphere Commerce Server.
- Ensure that you run the promotion migration utility as the wasuser user.
To do so, issue the following command: su - wasuser_ID where wasuser_ID is the non-root user ID created before installing WebSphere Commerce. The default WebSphere Application Server user name is wasuser.
- Open a command prompt window.
- Run the promotion migration utility with arguments specifying the location of any custom files, as well as the build file and the information needed to connect to a database in the server environment.
This migration script calls an ANT task that loads the configuration files and the XSL template files, applies the transformations, and then saves the data to the database tables. Error conditions will be written to standard output.
- Call the migration script with the following command:
- WCDE_installdir/bin/migratePromotions.bat –customControlInfoFile customFile.xml -verbose
- –customControlInfoFile
- (Optional) Indicates that you want the command to use the custom Control Info configuration file. If you created a custom Control Info configuration file earlier in this procedure, replace customFile.xml with the fully qualified path and filename of the custom Control Info configuration file. If you did not create a custom Control Info configuration file, do not specify this parameter; as a result, the migration utility uses the default Control Info configuration file (promotionMigrationControlInfo.xml).
- -verbose
- (Optional) Indicates that you require additional logging for use when debug the command.
Note that all logging is sent to the WCDE_installdir/logs/migratePromotions.log file.
- Call the migration script with the following command:
- WC_INSTALL/bin/config_ant.bat -buildfile WC_INSTALL/migration/optional/components/component-services/subcomponents/promotion/config/PromotionsMigration.xml -DinstanceName=instance -DdbUserPassword=database_password -DcurrentPropFile=instance.properties -DcustomControlInfoFile=customFile.xml -logfile migratePromotions.txt -verbose
- WC_INSTALL/bin/config_ant.sh -buildfile WC_INSTALL/migration/optional/components/component-services/subcomponents/promotion/config/PromotionsMigration.xml -DinstanceName=instance -DdbUserPassword=database_password -DcurrentPropFile=instance.properties -DcustomControlInfoFile=customFile.xml -logfile migratePromotions.txt -verbose
- -buildfile
- (Required) Specifies the build file to use for the migration. This parameter must be followed by the path to the migration build file as shown.
- -DinstanceName
- (Required) Specifies the instance to migrate. When using this parameter, replace instance with the name of the WCS instance for which you are migrating the promotions.
- -DdbUserPassword
- (Required) Provides the password to use to connect to the database. When using this parameter, replace database_password with the WebSphere Commerce database user's password.
- -DcurrentPropFile
- (Optional) Specifies the full path and name of the database properties file. The database properties file is used when a database, other than the one specified in the instance.xml file, is to be updated. This file takes the same format as the createInstance.properties file found under the WC_INSTALL/instances/instance/properties directory. The database section in the properties file is used to acquire the parameters required for the migration utility.
- –DcustomControlInfoFile
- (Optional) Indicates that you want the command to use the custom Control Info configuration file. If you created a custom Control Info configuration file earlier in this procedure, replace customFile.xml with the fully qualified path and filename of the custom Control Info configuration file. If you did not create a custom Control Info configuration file, do not specify this parameter; as a result, the migration utility uses the default Control Info configuration file (promotionMigrationControlInfo.xml).
- -logfile
- (Optional) Specifies the location of a log file. When using this parameter, replace migratePromotions.txt with the the fully qualified path and filename of a file to contain logging information, for example, C:\logs\migratePromotions.txt. If you do not specify this parameter, then logging information is displayed in the console.
- -verbose
- (Optional) Indicates that you require additional logging for use when debug the command.
Related concepts
Migration limitation for certain order-level promotions
Related tasks
Migrate promotions: partial migration
Migrate promotions built on custom promotion types
Migrate coupon data to digital wallets
Related reference
Sample promotionMigrationConfig XML file
Sample promotionMigrationControlInfo XML file
Sample OrderLevelPercentOff XSL template
Partial migration XSL template
Promotion type mapping in the promotion migration utility