Exports, Snapshots, and Comparisons

by Rob Miller last modified Feb 04, 2009 02:34 AM

More of the high level GenericSetup overview, wherein we learn how to export profiles, and how to use snapshots.

The first thing you notice upon clicking on the 'export' tab of the portal_setup tool is how similar it is to the 'import' tab.  It shows you a list of available steps (these are the export steps from export_steps.xml, of course), as well as two buttons at the bottom.  One of the buttons says "Export selected steps" while the other reads "Export all steps".

These export steps are linked up to code that knows how to examine the actual site setup and, from this, generate the appropriate XML files for a GenericSetup profile that would replicate the current setup.  If you click on the "Export all steps" button, you're browser should pop-up a file download dialog window, asking you where you want to save your setup_tool-YYYYMMDD######.tar.gz file.  This file, when extracted, contains the XML files and directory structure for your GenericSetup profile.

It is important to note that the "active" site configuration, as specified on the properties tab of the setup tool, does NOT have an direct impact on the export process.  Whenever an export is run, all of the specified steps are exported in full.  In other words, if Guy Ablaze were to make the membrane profile active and then run an export, he would get (among other things) an export of ALL of the tools that exist in the site, even though the membrane profile only lists a single tool in the toolset.xml file.

In addition to file system exports, it is also possible to create aprofile snapshot that lives entirely within the ZODB.  If you click on the portal_setup "snapshots" tab you will see a "Create a Snapshot" button.  Clicking on this button will do an export, only instead of offering you a tarball for download, instead it will create a new folder inside the "snapshots" folder in the setup tool.  This new folder will contain ZODB file and folder objects which contain all of the XML that defines the site configuration at the time the snapshot was run.

Also useful in the setup tool is the "comparison" tab.  On this tab you are able to pick between any two profiles, including any snapshots that you've created, and generate diffs between them to see what has changed.  Here's an example of what this might look like:



In this example I've run a comparison between the "Plone Site" profile, which is the default Plone configuration, and a snapshot that I created just before the comparison.  In so doing, I can easily tell what had been changed since the original Plone site creation.