Document activity backup and restore

Document activity backup and restore

DATA CENTER

Backup and restore

Document Activity is included in Confluence instance backups in Comala Document Management 7.0

In the initial data center only release (Comala Document Management v7.0), events in the legacy page activity and new document activity for a page are the same. New workflow events might be added in subsequent releases, and these will only be included in the document activity, not the legacy page activity.

Restored spaces need to be re-upgraded from the legacy page activity data.

Legacy Page Activity data in XML format

After upgrading your data in each space to utilize Document Activity, data continues to be stored in XML format for the life of Comala Document Management 7.0, and a recovery path is available. This recovery path only restores the Page Activity that occurred before the data upgrade was undertaken.

Consolidating spaces from one data center instance to another instance

In some scenarios, after installing Comala Document Management 7.0+, you might want to consolidate one or more spaces from one Confluence Data Center instance to another instance by:

  • Exporting a space from a data center instance A

  • Importing the space to the date center instance B

Depending on the document activity data upgrade status for the space in the origin instance, A, the following issues seen by users in the destination instance, B, might need resolving:

  • Case 1 - Upgraded / Upgrade not required space: Document Activity is empty

  • Case 2 - Space with no upgrade run: Page Activity has user links broken

Solution steps

Both cases 1 and 2 have to perform the user ID replacement, but only case 1 spaces have to perform the revert and upgrade actions. For each space that has been imported into a data center instance, the following actions have to be performed in the indicated order:

  1. Make a backup of your database

  2. Replace instance A user IDs with instance B corresponding user IDs in the database

  3. (Only Case 1) Revert the upgrade

  4. (Only Case 1) Upgrade the space again

1. Make a Backup of your Database

As you are about to perform updates directly in your database, you should first make a backup just in case.

2. Replace User IDs

The user IDs from instance A and instance B do not match; any user-related data in the workflow activity needs to be replaced with the destination IDs.

There are four properties in the database where the user IDs need to be replaced. For reference, these properties can be retrieved with (there is no need to retrieve them):

SELECT text_val FROM os_propertyentry WHERE entity_key in ( 'com.comalatech.states', 'com.comalatech.workflow.approvals', 'com.comalatech.states.latest', 'com.comalatech.workflow.approvals.latest' )

 So, for each space that has been imported, one update query must be performed for each user ID using an appropriate query for your database:

-- Replace SPACE_KEY placeholder with the correspondent space key -- where replacement will be applied -- Replace the OLD_VALUE placeholder with the text to be replaced -- Replace the NEW_VALUE placeholder with the new text that will replace the old one -- PostgreSQL UPDATE os_propertyentry os SET text_val = REPLACE(text_val, 'OLD_VALUE', 'NEW_VALUE') FROM content c JOIN spaces s ON c.spaceid = s.spaceid WHERE os.entity_id = c.contentid AND s.spacekey = 'SPACE_KEY' AND os.entity_key IN ( 'com.comalatech.states', 'com.comalatech.workflow.approvals', 'com.comalatech.states.latest', 'com.comalatech.workflow.approvals.latest' ) AND os.text_val IS NOT NULL;
-- Replace SPACE_KEY placeholder with the correspondent space key -- where replacement will be applied -- Replace the OLD_VALUE placeholder with the text to be replaced -- Replace the NEW_VALUE placeholder with the new text that will replace the old one -- Microsoft SQL Server UPDATE os SET os.text_val = CAST(REPLACE(CAST(os.text_val AS nvarchar(max)), 'OLD_VALUE', 'NEW_VALUE') AS ntext) FROM OS_PROPERTYENTRY os JOIN [CONTENT] c ON c.CONTENTID = os.entity_id JOIN SPACES s ON c.SPACEID = s.SPACEID WHERE os.entity_key IN ( 'com.comalatech.states', 'com.comalatech.workflow.approvals', 'com.comalatech.states.latest', 'com.comalatech.workflow.approvals.latest' ) AND s.SPACEKEY = 'SPACE_KEY' AND os.text_val IS NOT NULL;
-- Replace SPACE_KEY placeholder with the correspondent space key -- where replacement will be applied -- Replace the OLD_VALUE placeholder with the text to be replaced -- Replace the NEW_VALUE placeholder with the new text that will replace the old one -- Oracle UPDATE os_propertyentry os SET text_val = REPLACE(text_val, 'OLD_VALUE', 'NEW_VALUE') WHERE os.entity_key IN ( 'com.comalatech.states', 'com.comalatech.workflow.approvals', 'com.comalatech.states.latest', 'com.comalatech.workflow.approvals.latest' ) AND EXISTS ( SELECT 1 FROM content c JOIN spaces s ON c.spaceid = s.spaceid WHERE c.contentid = os.entity_id AND s.spacekey = 'SPACE_KEY' ) AND os.text_val IS NOT NULL;

3. Revert the Document Activity Upgrade (Only Case 1)

This action should only be performed if the status of the imported space in the Document Activity Upgrade is either:

  • No upgrade required. Space created using new capabilities, or

  • Upgrade Successful

To remove any metadata related to the Document Activity, you must take the following steps:

  1. Enable Read Only mode

  2. For all the imported spaces:

    1. Select in the list of spaces the imported space (only one)

    2. Run the Revert Upgrade action

    3. Repeat for the rest of the spaces

  3. Disable Read Only mode

After performing the above, no workflow history-related data will be lost, and all the imported spaces can access the old Page Activity. However, the new Document Activity won’t be available at this point.

4. Perform the Document Activity Upgrade (Only Case 1)

This action should only be performed if the status of the imported space in the Document Activity Upgrade is either:

  • Check successful or

  • Check not started

To make the Document Activity data available in the imported spaces, undertake the following:

  1. Enable Read Only mode

  2. Select all the imported spaces in the list of spaces (if there is a large number of spaces, you can undertake this in separate batches to avoid any impact on performance)

  3. Run the Document Activity Upgrade action

  4. Disable Read Only mode

 

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.