Filtering data for the stagingprop utility to propagate

We can filter the data that the stagingprop utility propagates to publish updates for only specific objects to our production database. We can filter data by tables, by change records, by custom filters, or by a combination of the filter options.

When you filter the data to propagate, you reduce the impact to site performance from the stagingprop process by reducing the amount of data that is being propagated. To filter the data, we can configure the utility to filter by table or by change record. When you run you run the utility, we can use command-line parameters to identify the filtering method and any required configuration file or value to use. We can filter data by using custom filters.

When we use a custom filter, the stagingprop utility propagates data that matches the filter. We can use multiple custom filters at a time to filter the data to propagate, but the filters must be defined within the same configuration file. A custom filter can filter data by criteria such as the store, locale, or object ID (for example promotion ID, category ID, or folder ID). Custom filters apply to only the objects and tables that are defined in the specified configuration file. If a table is not included in any filter definition within the configuration file, the contents of that table are propagated normally. For example, if you have catalog and promotion data that is flagged for propagation and you configure custom filters for promotions, the stagingprop utility propagates the specific promotion data that matches the custom filters and propagates all of the catalog data that is flagged for propagation.

We can use more than one filtering method at a time. For example, if you have catalog and promotion data that is flagged for propagation, we can use custom filters to filter the promotion data and include a custom list that configures the stagingprop utility to propagate only the data within promotion-related database tables. With these filtering methods combined, the stagingprop utility propagates only the promotion data that matches the custom filters, not the catalog data.

Note: By using custom filters, we might not need to modify the triggers for the INSERT and UPDATE operations on the staging database for use in updating the production database. If you include the queries to fetch INSERT and UPDATE propagation data in the staging filter configuration file, you need to modify only the triggers for DELETE operations. If you use the change record filtering option, you need to modify the triggers for the INSERT, UPDATE, and DELETE operations.

For INSERT and UPDATE operations that use custom filters, the staging process uses the custom filter configuration and the primary key values in the STAGLOG table to associate records with the appropriate tables in the staging database and fetch the filtered records for propagation.

For DELETE operations that use custom filters, the staging process cannot fetch or query the records in the staging database. The records are already deleted in the staging database so the staging process cannot determine whether a custom filter applies, such as whether a deleted record was associated with a particular store ID. The only way to identify that a record primary key is associated with a custom filter value is to record the association before you delete the record. We must continue to use the AFTER DELETE trigger associated with the STAGLOG table to determine this association for DELETE operations.


Procedure

When we are applying filters to the stagingprop utility process, we can use any of the following filter methods:


Related tasks
Creating a staging filter configuration XML file
Listing managed tables
Creating a database table filter list
Publishing data to the production database
Creating SQL triggers to override WebSphere Commerce database table triggers


Related reference
Example: Propagating filtered promotion data to the production database
stagingprop utility