How to restore space shortcuts after import from XML

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

After Restoring from XML from an XML backup of your Confluence instance, users complain that their space shortcuts are no longer present in the system.  Although the XML import was largely successful, some number of users do not have their space shortcuts when they login to Confluence. There are no errors form the restore, but you can gather a copy of the space shortcuts if you have retained a backup of the previous database for Confluence.

Diagnosis

Please Note that all queries herein were written and tested on PostgreSQL. If you are working with another database repository, the queries will need to be altered to suit your database of choice.

Requirements

In order to diagnose the issue properly, you need to have on hand:

  1. The current Confluence database
  2. A previous backup of the Confluence database
  3. The ability to run queries against both the production and the backup database
  4. Run the following query on both the original backup  and the new production database:

    SELECT * FROM "AO_187CCC_SIDEBAR_LINK" WHERE CATEGORY = 'QUICK';
  5. Save the queries as CSV files

  6. Compare the two results - the original backup result will contain the missing space shortcuts in its CSV

Cause

Currently, when restoring a full XML backup to a different instance, the space shortcuts are not imported and are lost to the new instance. This is a known issue:  CONF-30831 - Getting issue details... STATUS , if this issue effects you, please vote for the issue to be resolved.

Workaround

To workaround this issue, run the following query against your original database:

COPY (SELECT * FROM "AO_187CCC_SIDEBAR_LINK" WHERE "CATEGORY" = 'QUICK') TO '/tmp/sidebar.csv' DELIMITER ';' CSV HEADER;

This will copy all of the space shortcuts out into a CSV file in the /tmp directory named sidebar.csv which is what you will use to import the missing space shortcuts into the new production database (or different instance).

Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

To import the CSV file back into the new production database, use the following query:

COPY "AO_187CCC_SIDEBAR_LINK" FROM '/tmp/sidebar.csv' WITH DELIMITER ';' CSV HEADER;

Your Space Shortcuts should now be restored into the new production database and ready for use in the new instance.

You can verify the results of the import with the following query:

SELECT * FROM "AO_187CCC_SIDEBAR_LINK" WHERE "TYPE" = 'PINNED_PAGE' AND "CATEGORY" = 'QUICK';

This will return all Space Shortcuts in the new instance, which should be the same as those from the old instance.

Resolution

There is no resolution to this issue at present other than the workaround as provided above. If you are effected by this issue, please consider voting for CONF-30831 - Getting issue details... STATUS .

Last modified on Feb 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.