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 premigration steps. It updates the Payments Schema to the WebSphere Commerce Payments, Version 6.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 your previous
release to the corresponding directory of WebSphere
Commerce Version
6.0:
- WC_installdir/payments/cassettes/third-party_cassette_name
Note: 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')
Note: 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.5, 5.6, or 5.6.1 database library is on a remote machine from where WebSphere Commerce, Version 6.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 6.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).
Running the copyDB command does the following on the database machine:Issue the following command to ensure that the SAVF is not empty:- 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
DSPSAVF FILE(EMPTYLIB/OLD_INSTANCE_NAME)
Note: 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 6.0 level.
- Create a temporary user profile. Ensure the user profile is granted
*SECOFR authority. For example:
- 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)
- Create a temporary user profile. Ensure the user profile is granted
*SECOFR authority. For example:
- Migrate Payments database using migratepaymentsdb script.
Complete the steps appropriate for your 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 name of the new Payments instance.
- version
- The version number: 5.5.0.0, 5.6.0.0 or 5.6.1.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.
- ./migratepaymentsdb.sh -dbtype db2 -dbname db_name -dbuser db_userID [-dbpass db_password]
-schema schema_name
-
- 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 your machine, for example, myhost.montreal.ca. The default value is localhost.
- port_number
- The Oracle listener port number. By default, the port is 1521.
- ./migratepaymentsdb.sh -dbtype oracle -dbname db_name -dbuser db_userID [-dbpass db_password]
[-hostname host_name] [-port port_number]
-
- 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 your database configuration:
db2 update db cfg for your_payments_db using logfilsiz 10000
Restart DB2.