I managed to get a bit of time on my flight to Lisbon the other day to make a few last changes to a tool I've been working on on and off for the last few weeks, to provide a standard way of loading (and dumping) the contents of Share sites for demonstration content.
I'd considered ways of doing this in the past, mostly when I've got frustrated with setting up sample content in the new Share instances I usually create for demos. Bootstrapping content via ACP files is the usual method of loading content that's employed by Alfresco's own patches, but that didn't really feel flexible enough and in any case, isn't able to package up some of the data which makes up a Share site, such as configuration stored in the sitestore AVM store.
I also wanted a tool which allowed content to be imported into an Alfresco instance running on a local machine, but also on remote machines as well. Sometimes I demo locally but other times I fire up one of my Amazon images instead. So it seemed like an external process was required.
Then we started discussing a few weeks ago what additional tutorials and sample content we could provide to partners to coincide with the upcoming Enterprise 3.4 release, and the possibility of reusing some of the great demo content from the Alfresco Cloud Trial. There seemed some overlap.
The result is this project, which I'm tentatively naming Share Import-Export, and which provides a set of Python scripts that can export site-based content and user information from Alfresco Share, and import that content into another Alfresco Share server. Some sample content is also provided from the Cloud Trial environment, kindly supplied by Paul Hampton.
The package is intended to help set up demonstration environments quickly, reliably and consistently. The scripts are not suitable for importing or exporting large volumes of content or for any general production use such as system backups.
The scripts work with versions 3.3 and 3.4 of Alfresco, and can work against 3.2 with a couple of small tweaks. No additional customisations are needed in Alfresco or Share, so you can export data from existing systems without any fuss.
What can be imported/exported?
Site members (users only at present)
Site dashboards, including dashlet configuration
All content held within the site (manual export via ACP)
User passwords and account enabled flags (all accounts enabled)
Activity feed entries
File system-level customisations (e.g. custom dashlets) and configuration
How does it work?
The scripts mimic a web browser logging into the Share web application, then invoke a number of mostly JSON-based web scripts to read and write data to and from the application. JSON is also used as the format for storing exported metadata and user information, since it is well-structured, human readable and lightweight. Python has strong support for JSON data via the json module. ACP format is used to package up site content.