When migrating the instance to another server, the existing Secure macros may fail to be decrypted due to a PGP Encryption key mismatch. When this happens, you will see an error similar to the image below. To solve this, you need to migrate the data of the AO_DCA036_GLOBAL_KEY_PAIR table from the old database to the newly migrated instance's database.
Confluence Server or Data Center
When decrypting a Secure macro after migration, an "Error" box appears (shown above).
CausePGP Encryption key mismatch after migration.
Before proceeding with the steps below, we strongly suggest creating the necessary backups or testing the steps first in a staging instance. The steps result in direct database changes. By doing a test run, you can ensure steps are followed correctly and are making the necessary changes.
Restore the old backup into a new instance with a separate database.
After restoring the backup into the new instance (let's name this instance Server A), check the PASS_PHRASE, PRIVATE_KEY, and PUBLIC_KEY from
AO_DCA036_GLOBAL_KEY_PAIRdatabase table of Server A
With the data, move to the new instance and update
AO_DCA036_GLOBAL_KEY_PAIRtable with the copied keys from Server A
After this, clear the plugin cache (as recommended by Atlassian).
Check if the migrated secure macros can be decrypted.