Stagingprop utility fails when propagating access control policy data
When you run the stagingprop utility to publish a store from the staging instance to the production instance, the utility fails when propagating access control policy data.
Problem
The problem occurs if you created a staging instance on the following versions of WebSphere Commerce:- WebSphere Commerce Version 8 Fix Pack 8 (8.0.0.8) or earlier
- WebSphere Commerce Version 8 Mod Pack 1 (8.0.1.0)
- For staging instances, the generated keys are restricted to the middle and upper range of values
- For production instances, the generated keys are restricted to the lower range of values
This issue was reported in APAR JR55762.
Solution
- Run the following SQL statements on your staging database and production database to verify
whether the primary keys for some access control policies are
synchronized.
select min(acpolicy_id), max(acpolicy_id) from acpolicy; select policyname from acpolicy where acpolicy_id in (select min(acpolicy_id) from acpolicy); select policyname from acpolicy where acpolicy_id in (select max(acpolicy_id) from acpolicy); select min(acaction_id), max(acaction_id) from acaction; select action from acaction where acaction_id in (select min(acaction_id ) from acaction ); select action from acaction where acaction_id in (select max(acaction_id ) from acaction );
- Compare the results. If the results are in completely different ranges, then you need run the
following script fixes to replace the access control policy data that is on the production instance
with the data from the staging instance. You need to complete this step only once. Future executions
of the stagingprop utility will not generate propagation errors. Note: This procedure overwrites any custom access control policies that you might have on your production instance. If needed, back up your custom policies and then reload the custom policies after you run the script fixes.
- Install one of the following maintenance packages:
- Version 8 Fix Pack 9 or later (8.0.0.9+)
- Version 8 Mod Pack 1 Fix Pack 1 or later (8.0.1.1+) or any later mod pack.
- On the staging instance, run the stagingprop utility with the
'actionOnError' parameter set to 1. For
example,
For more information about how to run the stagingprop utility, see stagingprop utility.stagingprop.bat -actionOnError 1 -sourcedb staging_db_name -destdb production_db_name -dbtype db2 -sourcedb_user user -sourcedb_passwd password -destdb_user user -destdb_passwd password
- Export the access control policy data from the staging instance by completing the following
steps. (A new acpExport utility is included in 8.0.0.9+ and 8.0.1.1+).
- Go to the WC_installdir/bin directory.
- Open the acpExport utility in a text editor.
- acpExport.db2.bat
- acpExport.oracle.bat
- acpExport.db2.sh
- acpExport.oracle.sh
- Edit the values to reflect your database credentials.
- Save and close the file.
- Run the acpExport utility to generate the export files.
- acpExport.db2.bat <dbpassword>
- acpExport.oracle.bat <dbpassword>
- ./acpExport.db2.sh <dbpassword>
- ./acpExport.oracle.sh <dbpassword>
- On the production instance, replace the current access control policies data with the exported
policies (A new acpImport utility is included in 8.0.0.9+ and 8.0.1.1+).
- Open the acpImport utility in a text editor.
- acpImport.db2.bat
- acpImport.oracle.bat
- acpImport.db2.sh
- acpImport.oracle.sh
- Edit the values to reflect your database credentials.
- Save and close the file.
- Run the acpImport utility to replace the access control policy data that is
on your production environment with the data from the staging environment.Note: This utility deletes the access control policy data that is currently on your production environment.
- acpImport.db2.bat <dbpassword>
- acpImport.oracle.bat <dbpassword>
- ./acpImport.db2.sh <dbpassword>
- ./acpImport.oracle.sh <dbpassword>
Note: If you are using a remote database, then manually copy the exported files to your production environment. - Reload any custom access control policies. That is, rerun the acpload, acpnlsload, or acugload utilities for your custom policies as needed.
- Open the acpImport utility in a text editor.
- Continue with the store publish process.
- Install one of the following maintenance packages: