This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

Copy Space Plugin

Name Copy Space Plugin
Vendor Atlassian Software Systems
Authors Don Willis
Homepage http://confluence.atlassian.com/display/CONFEXT/Copy+Space+Plugin
Issue Management http://developer.atlassian.com/jira/browse/CPSP
Continuous Integration n/a
Categories Administration
Most Recent Version 0.1.1
Availability Confluence v2.8-m7-r2 to v2.10
State Beta
Support Unsupported Plugins
License Freeware / Open Source (BSD)
Price Free
Release Docs http://confluence.atlassian.com/display/CONFEXT/Copy+Space+Plugin
Java API Docs http://maven.atlassian.com/contrib/com/atlassian/confluence/plugin/confluence-copyspace-plugin/0.1.1/confluence-copyspace-plugin-0.1.1-javadoc.jar
Download Source http://maven.atlassian.com/contrib/com/atlassian/confluence/plugin/confluence-copyspace-plugin/0.1.1/confluence-copyspace-plugin-0.1.1-sources.jar
Download JAR confluence-copyspace-plugin-0.1.1.jar

Although this plugin was developed by an Atlassian developer it IS NOT SUPPORTED BY ATLASSIAN. Use it at your own risk and feel free to fix bugs in it yourself if you find them. That's why it's in the contrib source repository. Note that it was initially written in a single day, and has had very little done to it since.

Description/Features

The copyspace plugin allows a space administrator to copy a space, including the pages within the space, but excluding (so far)page history, blog posts and email.

Existing Features

  • Only available to Space Administrators (and full admins)
  • Makes a copy of a space, taking the new name and space key from the user
  • Copies the space description
  • Copies the space and team labels
  • Copies labels on pages in space. Personal labels are optional.
  • Copies the current versions of all pages, in their proper hierarchy
  • Copies the space permissions
  • Copies the page level restrictions on all pages
  • Optionally Copies the attachments on all pages
  • Copies the current theme, logo and colour scheme of the space
  • Copies the page templates
  • Copies custom layouts
  • Optionally copies all comments on all pages, leaving their authors and dates intact.
  • By default makes the current user the author of all non-comment content in the copy, and stamps them with now.
  • Optionally uses the original dates and users instead. (Not thoroughly tested for all of the above yet)
  • Provides a link from the copied space back to the orignal space

Current Limitations

  • Doesn't copy Blogs
  • Doesn't copy Mail
  • Doesn't copy past versions of anything
  • Doesn't give a progress bar (Long Running Task) for time consuming copying.
  • Does everything in one transaction
  • Probably doesn't work for some plugins, eg those that "attach" data to a space in bandana or properties to a page in OS_property.
  • UI still ugly
  • Virtually no unit tests

Installation

Once again, if I haven't got the repo working yet, don't worry. Just download the jar from above and install it the old fashioned way.
Please see the instructions on the Installing Plugins and Macros page.

Usage

To copy a space, go to Space Administration and click the "Copy Space" link, then fill in the form.

Required Permissions

Obviously it would not be good if everybody could copy a space. In order to see and use the Copy Space link, a user must have two permissions:

  1. The global "Create Space" permission
  2. The Administer Space permission on the space to be copied

Version History

Version Date State License Price
Show description 0.1.1 (#6) 02 Dec 2008 Beta Freeware / Open Source (BSD) Free

Release Notes

Fixes CPSP-13. Space logos are now copied in 2.9+. They already worked in 2.8.

Implements CPSP-07. Custom layouts are now copied.

Contributors

  • Don Willis — Developer

Show description 0.1.0 (#5) 20 May 2008 Beta Freeware / Open Source (BSD) Free

Release Notes

Fixes CPSP-11. Copying a space now preserves manual page ordering. This version is incompatible with Confluence 2.7 and below.

Contributors

  • Don Willis — Developer

Show description 0.0.12 (#4) 20 May 2008 Beta Freeware / Open Source (BSD) Free

Release Notes

Fixes CPSP-9 and CPSP-10. This is the last version that will be compatible with Confluence 2.5 to 2.7

Contributors

  • Don Willis — Developer

Show description 0.0.11 (#3) 11 Sep 2007 Beta Freeware / Open Source (BSD) Free

Release Notes

Copying Personal Labels is now optional.

Contributors

  • Don Willis — Developer

Show description 0.0.10 (#2) 06 Sep 2007 Beta Freeware / Open Source (BSD) Free

Release Notes

Bug fixes: CPSP-1, CPSP-2

Contributors

  • Don Willis — Developer

Show description 0.0.9 (#1) 05 Sep 2007 Beta Freeware / Open Source (BSD) Free

Contributors

  • Don Willis — Developer

Open Issues

Screenshots

(out of date)

Related Plugins

The Remote Import plugin can be used to copy spaces between different Confluence instances.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Oct 01, 2007

    neeraj says:

    Hi if i use the checklist macro which set that metadata for the pages , and aft...

    Hi

    if i use the checklist macro which set that metadata for the pages , and after that i try to copy that space where that checklist macro is used ,than , new copied space page does not have checklist metadata ...

    how can u retrieve the checklist metadata in copied space pages

    if export that space than there is no label are exported ? 

    thanks  

    1. Oct 02, 2007

      Don Willis says:

      Hi Neeraj, The Checklist macro may store its metadata in Bandana, or some othe...

      Hi Neeraj,

      The Checklist macro may store its metadata in Bandana, or some other location not copied by the Copy Space Plugin.

      I think the only way this plugin could play very nicely with other plugins is if it publishes an event to say the space has been copied. Then other plugins could listen for that event.

      Or it could copy the Bandana Context for the space. The reason it doesn't is that there may be things in that context that assume they are globally unique. It seems the lesser of two evils to create a space that is missing something rather than break some global invariant.

      Cloning the Bandana Context could be an "option".

      1. Oct 02, 2007

        David Peterson [CustomWare] says:

        My guess is that the problem is that Copy Space does not copy ContentProperty va...

        My guess is that the problem is that Copy Space does not copy ContentProperty values for content (as provided by the ContentPropertyManager). The main reason for this would be that Atlassian has not provided any methods to get a list of the content values stored. That would be the real solution - allow that list to be accessible to plugins, then add that support to this plugin.

        You will have problems with several plugin, including Scaffolding, and a few others.

        1. Oct 02, 2007

          Don Willis says:

          All true.

          All true.

          1. Oct 04, 2007

            neeraj says:

            Hi Bandana is storing only bandana value(copyspace.copier.spacekey   ...

            Hi

            Bandana is storing only bandana value(copyspace.copier.spacekey   --  <string>TestingSpace</string>) not  checklist  metadata value  ?? am i right ?

            os_propertyentry is storing the metadata value ..

            so how can i use that value in cop[y space 

            1. Oct 04, 2007

              Roberto Dominguez says:

              The checklists plugin uses the metadata-like properties, and they are stored thr...

              The checklists plugin uses the metadata-like properties, and they are stored through ContentProperityManager (os_propertyentry table). It uses also its own properties to store change history.

              As pointed out by David, there are no methods in ContentPropertyManager to retrieve property names, however I realized that Backup and Restore do handle properties in AbstractXmlExporter.addPropertiesForContent.

              So Dan, would it be possible to do the same in this plugin? Pretty much retrieving the value names from propertySetManager.getPropertySet(contentObject).getKeys() and retrieving their values using ContentPropertyManager. Another option would be using BucketPropertySetDAO.getKeys(...).

              For completeness, the plugin should also copy the Space's bandana values, and I think the values can be retrieved the same way

              1. Oct 04, 2007

                Don Willis says:

                Okay, I fold. I'll add it in next time I have time to look at the plugin (which...

                Okay, I fold. I'll add it in next time I have time to look at the plugin (which may not be soon).

                From the brief look I had into ContentPropertyManager yesterday it looks like the interface doesn't let you get the keys but the implementation does, so maybe I can do it by checking the type, casting and displaying a warning if it's the wrong one (and not copying the types).

                If anybody else wants to do it, of course you're welcome. Just create an enhancement request in the http://developer.atlassian.com/jira/browse/CPSP and assign it to yourself so people know you're working on it.

  2. Oct 04, 2007

    neeraj says:

    Hi is there any way ? just like below code if i use in code space plugin sour...

    Hi

    is there any way ? just like below code if i use in code space plugin source

    get value

    public String getGoogleApiKey()

    return (String) bandanaManager.getValue(new ConfluenceBandanaContext(),GmapsManager.GOOGLE_MAPS_API_KEY);

    set value

    bandanaManager.setValue(new ConfluenceBandanaContext(), GmapsManager.GOOGLE_MAPS_API_KEY, updateApiKey);

  3. Oct 08, 2007

    Gary S. Weaver says:

    Don, This plugin would be really helpful for us, since we have one organization ...

    Don,
    This plugin would be really helpful for us, since we have one organization (the group controlling the official student groups) that would like to be able to copy a template space to create each of the student groups spaces as they are requested.

    However, in order to reduce support calls due to other space admins copying spaces for no good reason and messing things up, it would be great to be able to specify which spaces have the ability to copy their space. It would be fine to leave the "copy space" link in space admin and just have it go to a page that said "not allowed" or similar for the spaces that are not allowed to be copied.

    Just added enhancement request: CPSP-3 

    If I have time I'd be happy to give you a hand with it. I've done a few other plugins now with bandana config and it's pretty easy once you get the hang of it. 

    Thanks!
    Gary

    1. Oct 08, 2007

      Don Willis says:

      I've replied to the feature request with a note about the current permission sit...

      I've replied to the feature request with a note about the current permission situation. I will document that here too.

      1. Oct 09, 2007

        Gary S. Weaver says:

        Sorry about that. I should have read through things a little more. (I just assum...

        Sorry about that. I should have read through things a little more. (I just assumed since I saw the link in space admin that it was available for every space admin, but instead typically it will only be available to confluence administrators (since they have create space permission) unless a space admin user specifically is granted the create space permission which will enable them to copy any space that they have space admin rights to.)

        Looks great! Thanks!!!

        Gary

  4. Oct 09, 2007

    Gary S. Weaver says:

    Only suggestion I have now is that it might be nice to have plugin configuration...

    Only suggestion I have now is that it might be nice to have plugin configuration where you could set the default values of the following flags for copy space. (for example, we'd probably default to not copy comments)
    * Use existing authors and dates
    * Copy comments
    * Copy attachments
    * Copy personal labels

    Just logged this as feature request http://developer.atlassian.com/jira/browse/CPSP-4

    Thanks!
    Gary

  5. Oct 09, 2007

    Gary S. Weaver says:

    I wonder whether it might be good in the Required Permissions section above to m...

    I wonder whether it might be good in the Required Permissions section above to mention that one (possibly recommended?) way for step #1 (to give a user the global create space permission) would be to setup a group via Administration -> Manage Groups called maybe "confluence-space-creators" (I don't know if it is a good idea though to include "confluence" in any group names since this seems to be somewhat reserved for Atlassian, but I think it might make sense here since it is group for the sole purpose of providing the create-space global permission?) or maybe "confluence-space-copiers"? And then give that group the create space permission via Administration -> Global Permissions -> (Groups section - edit permissions button) -> (Grant browse permissions to - enter name of group you just created) -> Add -> (edit? and) Check off create space next to that group and save. Assuming that this plugin gets sucked into the main Confluence distribution for 2.7, etc. maybe it might be good to go ahead at that point and suggest that Confluence create that group by default?

    1. Oct 09, 2007

      Don Willis says:

      I don't really see the need for such suggestions of how people manage their grou...

      I don't really see the need for such suggestions of how people manage their groups and permissions here. That's up to the individual administrator I think. I don't really expect people to go making insane numbers of copies of spaces.

      Assuming that this plugin gets sucked into the main Confluence distribution for 2.7, etc.

      While I'm flattered that you like my plugin, I can assure you with as much certainty as I can imagine, that this plugin will not be bundled with or sucked into Confluence 2.7. Note the big warning at the top about it being unsupported.

      1. Oct 10, 2007

        Gary S. Weaver says:

        That's unfortunate. Yeah, the main reason I mentioned that was because if Confl...

        That's unfortunate. Yeah, the main reason I mentioned that was because if Confluence at some point did integrate this plugin like they did for some others (tasklist got sucked up into it, right?), it might be more manageable. I saw your warning at the top. Just overly optimistic I guess (which is not a normal trait for me!).

  6. Oct 10, 2007

    neeraj says:

    Hi copy space plugin is not working properly with Confluence2.6 , after copy th...

    Hi

    copy space plugin is not working properly with Confluence2.6 , after copy the space children pages are not copied ..

    and during copy System error is coming

    *Cause:*
    | org.springframework.transaction.UnexpectedRollbackException: Transaction has  been rolled back because it has been marked as rollback-only\\
     &nbsp;at  org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:469) |
    
    *Stack Trace:* \[hide\] org.springframework.transaction.UnexpectedRollbackException: Transaction has been rolled back because it has been marked as rollback-only
    	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:469)
    	at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:266)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    	at $Proxy64.publishEvent(Unknown Source)
    	at com.atlassian.confluence.pages.DefaultPageManager.publishUpdateEvent(DefaultPageManager.java:405)
    	at com.atlassian.confluence.core.DefaultContentEntityManager.saveContentEntity(DefaultContentEntityManager.java:53)
    	at sun.reflect.GeneratedMethodAccessor366.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:585)
    	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    	at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor
     

  7. Oct 21, 2007

    Doods Perea says:

    Hi Don - the links to the jar file API and source seem to be broken as I get a 4...

    Hi Don - the links to the jar file API and source seem to be broken as I get a 404 browser error when I click any of them.

    regards,

    1. Dec 09, 2007

      Don Willis says:

      That's because they're not there. No idea why right now. I created an issue fo...

      That's because they're not there. No idea why right now. I created an issue for it, http://developer.atlassian.com/jira/browse/CPSP-8

      In the meantime, the source is all at http://svn.atlassian.com/fisheye/browse/public/contrib/confluence/copyspace-plugin/tags

  8. Dec 21, 2007

    Greg Miller says:

    I don't need any extra features for this - I'd just like it to not "time out" wh...

    I don't need any extra features for this - I'd just like it to not "time out" while copying a space. Is there a way to run this in some sort of "batch mode" directly on the server? Right now when I go to copy a space (it's a fairly large space) the web browser times out - any ideas on how to get around this?

    Thanks,

     -Greg

    1. Dec 23, 2007

      Don Willis says:

      I've always intended to implement a progress bar to solve this problem. In the ...

      I've always intended to implement a progress bar to solve this problem. In the meantime, you could try messing with your browser settings, or you could just not worry about it. The request will happily continue to copy the space without caring whether your browser is waiting for it or not. If you want to know whether the copying is finished, just keep trying to go to the space. The whole copy is in a single transaction, so if you can see the space at all, it's finished copying.

  9. Jan 08, 2008

    David Perez says:

    I definetly need this plugin. I tried to install it and got the error attached. ...

    I definetly need this plugin. I tried to install it and got the error attached.

    Any help would be appreciated. Thanks in advance.

    1. Jan 08, 2008

      Don Willis says:

      What version of Confluence are you running?

      What version of Confluence are you running?

      1. Jan 09, 2008

        David Perez says:

        Version: 2.3.3 Build:#645

        Version: 2.3.3 Build:#645

      2. Jan 09, 2008

        David Perez says:

        I see - we probably need to upgrade, right? Any workaround?

        I see - we probably need to upgrade, right?

        Any workaround?

        1. Jan 09, 2008

          Don Willis says:

          Yeah, you need to upgrade to at least 2.5 for the Copy Space plugin. The only ...

          Yeah, you need to upgrade to at least 2.5 for the Copy Space plugin.

          The only workaround I can suggest is to check the code out from http://svn.atlassian.com/svn/public/contrib/confluence/copyspace-plugin/trunk/ and modify it to work against 2.3. It's probably only the permissions that have changed between 2.3 and 2.5. The older ones actually should be simpler. Making it work would probably require a fair bit of knowledge. On the other hand if you can live without the page permissions being copied over (eg if you don't use them), then I'm guessing the modification shouldn't be too hard, since it would just be commenting bits out.

          If you do create a version that works for 2.3, please check it into a branch in the svn repository so that other people can use it.