Stashing |
Understanding "stashing"Stashing is the process of making a safe temporary copy of production data that is in danger of getting lost during upgrade. Before the upgrade, you stash the data. After the upgrade, you re-import it in a different form. Delivery Manager proposes a standard way of implementing "stashing", which is to export the data to an XML file in a pre-upgrade script (using INVOKE XML.EXPORT), then to change its name or form (or both) by applying an XSLT transformation, and then to re-import the data from XML in a post-upgrade script (using INVOKE XML.IMPORT): This default implementation of "stashing", however, is not always ideal. There could be performance or storage penalties if the volume of the exported, duplicated data is very large. There are numerous alternatives. To prevent data export but still rename an ADDRESS column to a HOME_ADDRESS column, you could plan as a first step to add the new column, then have the RDBMS duplicate the data from the old to the new column, and then drop the old column. The drawback of such a procedure is that the Rules Engine is bypassed so that you need to validate data integrity after the fact. Implementing "stashing"Follow these steps to prepare stashing and reclaiming data on target machines during upgrade, using the default XML/XSL implementation :
INVOKE XML.EXPORT WITH SELECT '$$stash\mystasheddata.xml' WriteOutputTo , query
INVOKE XML.EXPORT WITH SELECT '$$stash\Parameters.xml' WriteOutputTo , * FROM MYPARAMETERS
•Either by adding XSL to the XML.EXPORT statement, or •By inserting an explicit INVOKE USXSL.APPLY2FILE statement in your Pre-upgrade or Post-upgrade script, in which case you can use the $$stash path variable in some or all of the (3) arguments.
INVOKE XML.IMPPORT WITH SELECT '$$stash\mytransformeddata.xml'
INVOKE XML.EXPORT WITH SELECT '$$stash\NewParameters.xml'
You are now ready to check the scripts, run the Release Scripts task, and distribute the result to target machines. On each target machine, stashing will execute correctly if the scripts are run in the order indicated by the sequence numbers in the filenames.
See Also |