how to import space with duplicate key without changing watches and created by
Asked by Syed Ehteshamuddin:

Hi All,  

Is there a way to import a space which has duplicate space key without changing created by and watches. I have tried several ways to copy a space like script runner, confluence cli but failed. tried doing manual change in xml but it doesnt change all keys.  
Is there a way to import space without effecting anything except space key??  

its a standalone server with 6.1.2 ver.


Answers:
author: AnnWorley
body: Hi Syed,

When you changed the XML, did you follow this doc: [How to copy or rename a space in Confluence](https://confluence.atlassian.com/confkb/how-to-copy-or-rename-a-space-in-confluence-169578.html)?

I tried the plugins listed on that page and both of them changed the "created by" to the admin user who copied the space. You already tried the CLI tool, so the XML find and replace is the best bet remaining.

Please let us know how it goes.

Thanks,

Ann

comments: author: Syed Ehteshamuddin
body: I tried doing find and replace and it failed stating duplicate space key. so assuming there are more occurance of it somewhere. I can just do find and replace for word "pi" but it could change lot many places where it should not. example between words like "pi" for "pizza" will change to new "spacekey+zza"


author: AnnWorley
body: Syed, please see this link [Solution 3](https://confluence.atlassian.com/confkb/how-to-copy-or-rename-a-space-in-confluence-169578.html#HowtocopyorrenameaspaceinConfluence-solution3)for details of what to search for, and let me know if that helps. :) Ann


author: Syed Ehteshamuddin
body: Hi Ann,  
I tried solution 3 it successfully imported the space and after re indexing I can search space name or page name but could not open.   
Getting error " Page not found, The page you were trying to reach could not be found: it may have been renamed or moved to another space, or the name you requested may be incomplete" and below it shows page which I cannot access and get same error.  

In Logs i can see error "ERROR \[http-nio-8090-exec-13\] \[plugin.descriptor.web.ConfluenceWebInterfaceManager\] getHtml Failed to render web panel:com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor$ContextAwareWebPanel@16aa8ec1 "  

Also could not see space in space directory to delete it. any suggestions how I can delete and try again?


author: Syed Ehteshamuddin
body: I have tried creating new space by same key and site just hangs. I tried by CLI and get this error:  
Remote error: org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only  

<br />

When I try deleting through remove space, I get  
Remote error: Cannot find space with key: PREDI


author: Syed Ehteshamuddin
body: [@AnnWorley](/t5/user/viewprofilepage/user-id/502040)is there a way to delete space other than UI?


author: AnnWorley
body: Hi Syed,

I was just looking at your case when I saw your update.

Based on the previous error, "Failed to render web panel", I wanted to share: [After updating a Third Party Add-on some functions may not be available or render incorrectly](https://confluence.atlassian.com/confkb/after-updating-a-third-party-add-on-some-functions-may-not-be-available-or-render-incorrectly-710837551.html) and ask you to try [Disabling or enabling all add-ons (using Safe Mode)](https://confluence.atlassian.com/upm/disabling-and-enabling-add-ons-273875716.html#Disablingandenablingadd-ons-Disablingorenablingalladd-ons(usingSafeMode))

For removing the space: If you are unable to access the space at all from the UI, you can run the deletion from the URL directly at:

```
 http://<baseURL>/spaces/removespace.action?key=<insert space key>
```

If that fails to work, refer to: [After a failed space import, it's not possible to re-import because of leftover space data](https://confluence.atlassian.com/confkb/after-a-failed-space-import-it-s-not-possible-to-re-import-because-of-leftover-space-data-217743668.html)

Because of the "page not found" message, please try reindexing from scratch as described in: [How to Rebuild the Content Indexes From Scratch on Confluence Server](https://confluence.atlassian.com/confkb/how-to-rebuild-the-content-indexes-from-scratch-on-confluence-server-110035351.html)

I look forward to your next update.

Thanks,

Ann


Tags: cli

configuration

confluence-app

export

import

permission

scriptrunner

server

space