Administer > Stage server


Stage server limitations

You should be aware of certain limitations before using the staging server.

If the staging server contains Web activities, promotions, or content spots, refresh the registry before any updates display on the site.


Stage database migration

You cannot migrate the staging database. See Create a staging server on a migrated environment for more information.


Key splitting

In general, when a staging server is available, you should only make content data change in the staging server and then propagate the data to the production server. However, there are scenarios when make an update on both the staging server and the production server. For example, in the reseller marketplace, the host (Site Administrator) updates the data on the staging server, while the reseller updates the data on the production server. This potentially causes a primary key collision.

WebSphere Commerce uses a key manager to generate primary keys for tables, and the key range is defined in the KEYS table. If the production server and staging server use the same key range, the key manager can allocate the same primary key value for the same table, on both the production and staging server, causing primary key collision. As a result, the key range must be split immediately after the staging instance and production instance are created. This ensures that the staging server and production server will use different key ranges.

There are different ways to split the key range. One approach is to change the values of the UPPERBOUND, LOWERBOUND, and COUNTER in the KEYS table. The following are sample SQL statements to split the key range on the staging and production servers:

Portion one

update keys set upperbound=(upperbound-lowerbound)/3 + lowerbound
where tablename in (select tabname from stgmertab) or tablename
 in (select tabname from stgsitetab)

Portion two

update keys set upperbound = (upperbound-lowerbound)/3*2 + lowerbound, 
lowerbound = (upperbound-lowerbound)/3 +lowerbound+1, counter = 
counter+(upperbound-lowerbound)/3 +1 where tablename in
 (select tabname from stgmertab)
 or tablename in (select tabname from stgsitetab)

Portion three

update keys set lowerbound = (upperbound-lowerbound)/3*2 + lowerbound +1
, counter = counter +(upperbound-lowerbound)/3*2 +1 where tablename in
(select tabname from stgmertab) or tablename in (select tabname from stgsitetab)

The first SQL statement, portion one, must be run on the production server. This ensures that the production server will occupy one third of the full key range. The second SQL statement, portion two, must be run on the staging server. This means that the staging server will occupy the second one third of the full key range. The third SQL statement, portion three, can be kept for a second potential staging server in the future.

The preceding key splitting SQL statements need to be run manually by the database administrator after the new staging server instance and the production server instance are created.

If key splitting needs to be done after the production server or staging server have been running for some time, then the preceding SQL statements may not work. This is because the current key counter may already be beyond one third of the full key range. If this is the case, check the details of the KEYS table and split the key range properly.


Update primary keys

The stagingprop utility does not support updating primary keys. The primary key of a table can be referenced by other data using either explicit foreign keys or implicit IDs; therefore, changing the primary key has many implications. Database management systems do not allow primary key changes when the primary key is referenced by a foreign key.

To update the primary key, you can delete it or, you can update all child rows in every child table to use another primary key.


Related concepts

Stage server utilities


Related tasks

Test the site on a staging server


+

Search Tips   |   Advanced Search