Thursday, 5 April 2018

Rename a space in Confluence


Generate the XML backup and create a test instance
  1. On the production server, login as an administrator.
  2. Go to Space -> Space Tools -> Content Tools -> Export -> XML -> Next -> Full Export -> Export Space and export the target space as XMLincluding attachments.


Extract the export backup file
  1. Open the space backup file with a zip file editor and find the file entities.xml.
  2. Edit entities.xml in a text editor.
  3. Do a 'Search & Replace' with the old space name and replace with New Space Name.

    Example:
    <property name="destinationSpaceKey"><![CDATA[DDT]]></property>
    <property name="lowerDestinationSpaceKey"><![CDATA[ddt]]></property>
Note:  Repalce with upper and lower case in entities.xml file using  sed commend "sed  's/old/new/g' entities.xml"
Edit the exportDescriptor.properties file
  1. Also edit the exportDescriptor.properties file in a text editor
  2. Change the spaceKey value in the exportDescriptor.properties file to the new spaceKey.

    Compress the attachments,entities.xml  and exportDescriptor.properties with .xml.zip format.

     zip -r Confluence-space-export-095347-136.xml.zip attachments entities.xml exportDescriptor.properties

    Note :

    To transfer zip file to test instance under "/hboprod/itdept/hbowiki/data/restore" directory.
    Restore to test instance for verification
    1. Loginto the test instance as a Confluence administrator.
    2. Go to ->General Configuration -> Backup & Restore. Under 'Upload a zipped backup to Confluence', browse to select the modified space backup. Check the 'Build index' option and select 'Upload & Restore'.

      If  everything working as expected then restore to production
      Restore On Production
      1. Backup your production instance now.
      2. Loginto the production instance as a Confluence administrator.
      3. Go to ->General Configuration -> Backup & Restore.

      When you access a Space, the sidebar is blank and Space Tools is missing - (Do this in non PROD and then export the space from non-prod and import to prod)

      Resolution

      1. Verify if there is a Duplicate Entry in "AO_187CCC_SIDEBAR_LINK"
        select * from "AO_187CCC_SIDEBAR_LINK" where "CATEGORY" = 'ADVANCED' AND "SPACE_KEY"='{SPACEKEY}';
        select * from "AO_187CCC_SIDEBAR_LINK" where "CATEGORY" = 'MAIN' AND "SPACE_KEY"='{SPACEKEY}';
      2. Change the  SPACE_KEY from the old to new key. Commit. Restart confluence to reflect the change.

No comments:

Post a Comment

Configure EKS Persistent Static Storage With Elastic File System Using Terraform

  checkout :https://youtu.be/QuUIgQWBBZM