Status: Gathering Impact
Affects Version/s: 5.4, 5.6.3, 5.7, 5.6.6, 5.6-OD-39-039, 6.10.2
Fix Version/s: None
Component/s: Content - Favourites
Symptom Severity:Severity 3 - Minor
Support reference count:48
Bug Fix Policy:
The import process misplaces Favourites on the database and they might disappear for one user and appear under another user.
The problem happens randomly when migrating Confluence because it depends on the order of the objects in the entities.xml file of the export. It affects Confluence Cloud and Server.
Steps to reproduce:
- Create 2 users with 2 favourite pages each
- Export Confluence Site
- Import Site
Expected: each of the 2 users have 2 favourites
Result: one user will have all favourites and the other none.
If it didn't reproduce: (how to manually make it fail)
- Open entities.xml inside the export
- Move object class="ConfluenceUserImpl" below the objects class="Label"
Confluence logs show the following message:
where 819202 is the id of the label that doesn't get inserted.
- Open entities.xml with a text editor and move all the object class="ConfluenceUserImpl" before the object class="Label" and try importing again.
The following steps will work for MySQL, you may need to change the syntax for other databases.
- Extract the favorites from the previous database with the following SQL query:
- As we want to transfer that data to a different database, I suggest you to create a CSV file with the output of the previous command which we will call old_favourite.csv.
- Copy old_favourite.csv to the server running your new Confluence database.
- Shutdown your current instance of Confluence to avoid data inconsistencies while we modify the database.
Please make sure you backup your data before you do any changes so we can roll back in case it is needed.
- Let's create a temporary table:
- Let's now dump the content of the CSV file into the temporary table. In PostgreSQL you should be able to do this with the following command:
You may need to modify the query depending on the format of the CSV file generated in step #2
- Now we will move the missing labels to the correct table in Confluence:
- Let's update the table CONTENT_LABEL to make sure it contains the correct information. We will need to run the following queries separately in MySQL:
- Clean up:
- To make sure the indexes also contain the updated information, I suggest you to rebuild your index from scratch:
- Make a backup of your <confluence-home>/index/plugin directory if it exists. This is where the Usage Tracking plugin stores it's index for the usage statistics and it cannot be rebuilt.
- Remove the <confluence-home>/index directory.
- If in step #9.1, you have the <confluence-home>/index/plugin directory, create the <confluence-home>/index directory and copy in the backup of <confluence-home>/index/plugin directory made in step 2.
- Restart server.
- Now perform the manual re-indexing of your site to build a brand new index from scratch