For ShipIt V I created a plugin that allows a Confluence space to be copied. This is partially in response to the existence of CONF-3191, but it’s more because the workaround is horrible. Occasionally when I’ve been working in support, I’ve been asked about how to copy a space, and it always makes me cringe.
The plugin I wrote provides an extra link on the Space Admin screen:
The user submits the form, with the new space name and key, then waits while their space is copied. The new space provides a link back to the original in the Space Admin screen.
The plugin duplicates most of the space’s attributes and content, including:
- the space description
- the space and team labels
- the labels on all the pages in the space
- the current versions of all pages, in their proper hierarchy
- the space permissions
- the page level restrictions on all pages
- the attachments on all pages
- the current theme, logo and colour scheme
- the page templates
- Optionally, all comments on all pages, leaving their authors and dates intact.
- Optionally, the author and editing time of all non-comment content in the copy, (otherwise the copier authoer and copy time is used).
Some of the space’s features are not copied (for no better reason than my not having time to implement it on ShipIt Day):
- News items (blogposts)
- past versions of anything (eg page history is not copied)
- things I don’t know about (eg if another plugin stores information about a space or its content somewhere, then that information is not copied. I didn’t provide a means for other plugins to be aware of space copying either. Publishing an event would be a good start.)
The space copying could really do with a progress bar too.