How to restore space shortcuts after import from XML
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
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.
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.
In order to diagnose the issue properly, you need to have on hand:
- The current Confluence database
- A previous backup of the Confluence database
- The ability to run queries against both the production and the backup database
Run the following query on both the original backup and the new production database:
SELECT * FROM "AO_187CCC_SIDEBAR_LINK" WHERE CATEGORY = 'QUICK';
Save the queries as CSV files
- Compare the two results - the original backup result will contain the missing space shortcuts in its CSV
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-30831Getting issue details... STATUS , if this issue effects you, please vote for the issue to be resolved.
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).
Alwaysyour 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.
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-30831Getting issue details... STATUS .