Links, Applinks, and macros fail when copying Jira and Confluence to other environments

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

When moving JIRA and Confluence to a different environment, most of the time in order to test, links between the two instances break. The new environments have different URLs, which affects the issue link in JIRA and page links in Confluence as they rely on application link which has been defined earlier on the older environment. The feature request JRASERVER-62850 Update Confluence Links In JIRA Automatically Based On The New Applink Configurations has been raised to address this issue and update the link automatically.

  • Does not apply to the Jira project import solution.
  • Does not apply to the Jira and Confluence Cloud solutions. 

In Atlassian Cloud URL structure, Confluence Cloud Page ID has some changes compared to the Confluence on-premise server.

Please refer to https://confluence.atlassian.com/confkb/after-a-successful-server-to-cloud-migration-url-links-are-broken-in-the-new-cloud-instance-1077781093.html


Cause

The new environment is using a different baseURL. Links and macros in JIRA and Confluence are dependent on the original baseURL.

When an applink between Jira and Confluence is created, it creates a record in the propertyvalue table using a GUID to define the relationship. If the serverID remains the same, the applinkID will remain the same, and the applink itself may show as working:

SELECT SUBSTR(a.property_key,16,36) as "appId", b.propertyvalue as "Application Name"
FROM propertyentry a join propertystring b on a.id=b.id where a.property_key like 'applinks.admin%name';

The values returned are as follows:

 appid, app name
 <GUID>,Confluence


The problem with the remote links and macros is that the URL has changed, and the values in the remotelink  table have not been updated to the new URL. You can verify this by running the following query in the Jira or Confluence instance where the links are not working:

SELECT * FROM remotelink WHERE URL is not null;

The returned information will show you that the <JIRA_URL> is still saved with the previous value:

 Jira Issue: SCRUM-23 (ID; 10022)
 global ID: <GUID>&pageId=1146882 (applink, confluence page id)
 title = jira defined variable
 url: <JIRA_URL>/confluence/pages/viewpage.action?pageId=1146882
 app type =- confluence (com.atlassian.confluence)

Resolution

Option 1:

Confluence

 Keep the same old server name for Jira for the migrated one but change the associated URL (recommended). The approach to achieve this is:

  1. Go to General Configuration in Confluence.

  2. Navigate to Application Links.

  3. Click on the Edit icon on the Jira link that is not working.

  4. Update the Application name to the OLD_JIRA_NAME you previously used. If this is lost, check the "How to find OLD_JIRA_NAME" section below.

  5. Save the changes.

How to find OLD_JIRA_NAME

  1. Go to the Confluence page where the Jira Applink is broken and it shows the error: "Unable to locate Jira server for this macro.It may be due to Application link configurations."

  2. Click on the options icon (...) at the top right, below the profile icon.

  3. Select View Storage Format.

  4. You will see <ac:parameter ac:name="server">OLD_JIRA_NAME</ac:parameter>. Note down the value OLD_JIRA_NAME .

Option 2: 

Jira 

Jira has a great XML Backup utility and XML backup contains the data

Hence, you can use the following steps to update the links in Jira. The approach to achieve this issue is:

  1. Take a backup of Jira: Backing up Jira.
  2. Extract the backup file.
  3. Open the entities.xml file in Notepad or another text editor.
  4. Search/replace the old Confluence link with the new one (according to your new environment). The replacement options can be found at How to replace all hard coded links after a base URL change.
  5. Restore the data to JIRA following our documentation:  Restoring data.

Option 3: 

Jira 

Editing directly from the Jira database

Editing directly the below SQL statement in the database.

Please Note: We strongly recommend to test the solution in a Staging environment and taking a backup of your database before updating the DB data.

1) Identify the appId for Confluence's app link with the following query:

SELECT SUBSTR(a.property_key,16,36) as "appId", b.propertyvalue as "Application Name" FROM propertyentry a join propertystring b on a.id=b.id where a.property_key like 'applinks.admin%name';

2) Identify the old Confluence appId or URL by checking the remotelink table:

SELECT * FROM remotelink WHERE URL like '%/pages/viewpage.action?pageId=%';

3) Update the relevant globalid to replace the OLD cloud confluence appId with the NEW confluence appId with the following query:

UPDATE remotelink SET globalid = REPLACE(globalid, 'OLD-APPLINK-ID','NEW-APPLINK-ID') WHERE globalid LIKE '%OLD-APPLINK-ID%';

4) Update the old confluence URL to the new one in the remotelink table:

UPDATE remotelink SET URL = REPLACE(URL, '<OLD_URL>','<NEW_URL>') WHERE URL LIKE '%<OLD_URL>/pages/viewpage.action?pageId=%';

5) Restart Jira to refresh the data cache.

Confluence

XML backup may not be a suitable solution for medium or large size instances of Confluence, so we don't recommend users to replace the links by editing the Confluence XML backup. Instead, we suggest customers to bulk edit the links from the database to replace the old Jira link with the new one (according to your new environment). A resolution to this issue for Confluence can be found at How to bulk update JIRA Issue Macro to point to a different JIRA instance.




DescriptionWhen moving JIRA and Confluence to a different environment, most of the time in order to test, links between the two instances break. The new environments have different URLs, which affects the issue link in JIRA and page links in Confluence as they rely on application link which has been defined earlier in the older environment.
ProductJira, Confluence
PlatformServer
Last modified on Mar 18, 2025

Was this helpful?

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