Migrate > Take the first steps after WebSphere Commerce migration > Migrating from a previous payment implementation > Migrating WebSphere Commerce Payments Multipayment Framework to v7 (compatibility mode)
Migrating Payments database
The Payments database tier migration script (migratepaymentsdb) collects database information to determine the version, release level, and database type. The script then runs the appropriate pre-migration steps. It updates the Payments Schema to the WebSphere Commerce Payments, v7.0 level. Based on the version and release, the script runs the Payments data migration command for the Payments Framework and IBM cassettes, and any installed third-party cassettes. The required tables for third-party cassette are copied to the migrated database, however, the cassette might not be fully functional until it is redeployed or reinstalled.
Procedure
- If you have any third-party cassette installed on your previous release, copy the following directory from the previous release to the corresponding directory of WebSphere Commerce Version 7.0:
- WC_INSTALL/payments/cassettes/third-party_cassette_name
BankServACH, CustomOffline, OfflineCard, Paymentech, and VisaNet are not the third-party cassettes. They are the default cassettes.
- Back up the Payments database.
Save the original payments instance library. For example:
SAVLIB LIB(previousPaymentsLibrary) DEV(*SAVF) SAVF(saveFile)
- If the previous and migrated Payments database are on the same machine, complete this step; otherwise proceed to step 4.
- Create a temporary user profile. Ensure the user profile is granted *SECOFR authority. For example:
CRTUSRPRF USRPRF(paytemp) PASSWORD (password) USRCLS(*SECOFR) CCSID(non_65535_value) TEXT('migration profile')
If your database is remote from the WebSphere Commerce system, create the same temporary profile on both the remote database machine and the local
- If the WebSphere Commerce, Version 5.6.1 or 6.0 database library is on a remote machine from where WebSphere Commerce, v7.0 is installed, add a relational database directory entry for the remote system on the system where WRKRDBDIRE command to work with relational database directory entries.
- Sign on to the WebSphere Commerce Version 7.0 machine with the new temporary profile and start a QSH session (STRQSH).
- Enter the following command:
WC60_installdir/bin/copyDB.sh HOSTNAME DATABASE_NAME NEW_INSTANCE_NAME NEW_INSTANCE_PWD OLD_INSTANCE_NAME EMPTYLIB
Where:
- host_name
- The hostname of the machine where the database resides.
- DATABASE_NAME
- The relational database name. Displayed using the command WRKRDBDIRE on the machine where the database resides.
- NEW_INSTANCE_NAME
- The name of the new Payments instance
- NEW_INSTANCE_PWD
- The password of the new Payments instance
- OLD_INSTANCE_NAME
- The name of the previous version Payments instance
- EMPTYLIB
- A native library used by migration for temporary storage (this library will be created or cleared as required).
Run the copyDB command does the following on the database machine:
- Creates a save file (SAVF), with the name of OLD_INSTANCE_NAME, in a library designated by EMPTYLIB
- Uses this SAVF to create a database schema with the name NEW_INSTANCE_NAME
Issue the following command to ensure that the SAVF is not empty:
DSPSAVF FILE(EMPTYLIB/OLD_INSTANCE_NAME)
If the database is remote, the DSPSAVF command is run on the remote database machine.
The newly created database schema (NEW_INSTANCE_NAME) will be the database that will be migrated to the WebSphere Commerce Version 7.0 level.
- If the previous and migrated Payments databases exist on separate machines, complete this step.
- Move the saved file, that was created of the previous Payments library, to the target machine.
- On the target machine, do the following steps:
- Create a temporary user profile. Ensure the user profile is granted *SECOFR authority. For example:
CRTUSRPRF USRPRF(paytemp) PASSWORD (password) USRCLS(*SECOFR) CCSID(non_65535_value) TEXT('migration profile')
- Sign on to the target machine with this new temporary profile.
- Restore the save file of the previous Payments library. For example: RSTLIB SAVLIB(previousPaymentsLibrary) DEV(*SAVF) SAVF(saveFile)
- Migrate Payments database using migratepaymentsdb script. Complete the steps appropriate for the platform and database.
- Sign on with the temporary Payments user profile.
- Start a Qshell session.
- Navigate to the following directory: WC60_installdir/bin
- Migrate the previous Payments database by running the following command:
./migratepaymentsdb.sh relationalDatabaseName databaseUserId schemaName version [databasePassword]
Where:
- relationalDatabaseName
- The name of the database where the payments schema resides (use the WRKRDBDIRE command).
- databaseUserId
- The user ID to connect to the Payments database that you are migrating (use the paytemp profile you created earlier).
- schemaName
- The database schema name of the new Payments instance.
- version
- The version number: 5.6.1.0 or 6.0.0.0.
- databasePassword
- The password for the user ID to connect to the Payments database that you are migrating. This parameter is optional. If you do not specify the password in the command, the script prompts you to enter the password when you run it.
- Open a shell prompt window, and switch to the WebSphere Application Server user ID, WAS_user, (for example, wasuser): su - wasuser
- Open a DB2 command window.
- Navigate to the following directory: WC60_installdir/bin
- Migrate the previous Payments database by running the following command:
- ./migratepaymentsdb.sh -dbtype db2 -dbname db_name -dbuser db_userID [-dbpass db_password] -schema schema_name
- migratepaymentsdb.bat -dbtype db2 -dbname db_name -dbuser db_userID [-dbpass db_password] -schema schema_name
Where:
- db2
- Specifies that you are migrating a DB2 database.
- db_name
- The Payments database that you are migrating.
- db_userID
- The user ID to connect to the Payments database that you are migrating.
- db_password
- The password for the user ID to connect to the Payments database that you are migrating. This parameter is optional.
- schema_name
- The name of the new Payments instance.
- Switch to the WebSphere Application Server user ID, WAS_user (for example, wasuser) : su - wasuser
- Navigate to the following directory: WC60_installdir/bin.
- Run the database tier migration script:
- ./migratepaymentsdb.sh -dbtype oracle -dbname db_name -dbuser db_userID [-dbpass db_password] [-hostname host_name] [-port port_number]
- migratepaymentsdb.bat -dbtype oracle -dbname db_name -dbuser db_userID [-dbpass db_password] [-hostname host_name -port -port_number]
Where:
- oracle
- Specifies that you are migrating an Oracle database.
- db_name
- The Payments database that you are migrating. For Oracle databases, this is the Oracle SID (System ID).
- db_userID
- The user ID to connect to the Payments database that you are migrating.
- db_password
- The password for the user ID to connect to the Payments database that you are migrating. This parameter is optional.
- host_name
- The fully-qualified host name of the machine, for example, myhost.montreal.ca. The default value is localhost.
- port_number
- The Oracle listener port number. By default, the port is 1521.
- When the migration completes, review the log file that is indicated in the "Event: Migration has finished successfully. Check the log file... " message that appears in the command window where you ran the payments migration script. If the migration of these cassettes is not successful, the migration script will indicate the problem. For example:
Event: Executing command: PaymentsCassetteMigration Event: running java program: com.ibm.commerce.payments.migration.PaymentsCassetteMigration InitiatingPayments cassettes migration. Initiating migration for OfflineCard Cassette. Migration for OfflineCard Cassette finished. Initiating migration for CustomOffline Cassette. Migration for CustomOffline Cassette finished. Initiating migration for Paymentech Cassette. Migration for Paymentech Cassette finished. Initiating migration for My3rdparty Cassette. Warning: Could not find My3rdparty cassette in the system, migrate the cassette manually.Payments cassettes migration finish.
- Increase the database log file size by updating the database configuration:
db2 update db cfg for your_payments_db using logfilsiz 10000
Restart DB2.
Next topic:
Migrate the Payments application