Importing and Exporting Share sites

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?
For sites

  • Site configurations
  • Site members (users only at present)
  • Site dashboards, including dashlet configuration
  • All content held within the site (manual export via ACP)
  • Records Management sites (must have RM installed)
  • Web Quick Start sites (must have WQS installed)

For users

  • All profile information, including profile images
  • User dashboard configurations
  • User preferences
  • User groups and group memberships

What is not imported/exported?

  • Document categories and tags (not currently supported by ACP format)
  • 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.
Download and Usage
Downloads and more information can now be found on the Share Import-Export project page.
Contributing
You can help by testing the scripts against your own test data and posting feedback, either by adding a basic comment below or (even better) by posting feedback in the Issues section.
You are welcome to redistribute the tools under an Apache 2.0 license and encouraged to submit any enhancements you make.

3 thoughts on “Importing and Exporting Share sites

  1. Hallo Will,
    quite a few times, I was faced with the requirements to (1:1) copy an alfresco space or a “logical part” – the share site being the common (special) case. Things get complicated as soon as you have to deal with other spaces/folders containing references/being referenced – users/groups, versioning, categories and multilanguage entities. So far the only solution we came up with was to exchange database exports and filesystem archives (the whole repo).
    I think the requirement to share 100% identical data is not so uncommon for development purposes.
    Is there anything in the works at alfresco to support creating really identical copies of only “a logical chosen part” ?
    regards
    Andreas

  2. Hi Andreas, sounds like an interesting requirement. As you’ve probably seen the import-export scripts use ACP to wrap up site content and that works pretty well. Although it does lack support for some of the features you mention such as versions and translations, it works fine for the sort of basic content I use for demos.
    Last time I checked there were some enhancements pencilled in for ACP on the Roadmap, so if these were addressed would that be a viable solution for you?

  3. Hi Will,
    thanks for the prompt response !
    Sure, (better) ACP support for creating 1:1 copies of data would be fine with me. 🙂
    No matter how a solution is implemented, I guess it won’t release one from worrying about references.
    regards
    Andreas

Comments are closed.