XML restore fails due to the attachment directory specified in the backup file is not valid
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Summary
After migrating Jira from one server to another the XML restore might fail with the error "the attachment path C:\program files\atlassian\application data\JIRA\data\attachments specified in the backup file is not valid". For this scenario it is likely that the <Jira_Home> variable is set to a different value between the old and new server hosting Jira.
For instance, when migrating from a Windows server to a Linux server or from a Windows server where the <JIRA_HOME> directory was set to use the C drive and on the new Windows server it is set to use the D drive.

Diagnosis
Extract the entities.xml file from the backup file being restored and search for the attachment path string found in the error presented when the XML restore is attempted.
You should see something similar to the example below:
1
<OSPropertyString id="10134" value="C:\program files\atlassian\application data\JIRA\data\attachments"/>
Please note that the "id" for the OSPropertyString identifying the attachments directory in your instance will vary so please reference this when performing the solution below.
Confirm if the directory listed is present in the server that you are using when performing the XML restore.
Cause
If the directory identified in the OSPropertyString for the attachments directory does not exist in the server running Jira this will cause the XML restore to fail immediately.
Solution
Unzip the backup being used for the XML restore.
Open the entities.xml file and find the entry indicating the attachment directory path similar to the below example:
1
<OSPropertyString id="10134" value="C:\program files\atlassian\application data\JIRA\data\attachments"/>
Update this entry to use the new directory that will contain the attachments for your Jira instance.
1
<OSPropertyString id="10134" value="D:\program files\atlassian\application data\JIRA\data\attachments"/>
For the example above the directory change was from the "C" to "D" drive in a Windows environment.
Re-zip (compress) the entities.xml and activeobjects.xml files into a single zipped file to use for the XML restore.
You will want to ensure that you do not zip the folder containing these files as it will cause an additional error, when performing the XML restore, indicating "
Error importing from zip file "<JIRA_HOME>/import/<zip filename>'. Error: Unable to find Jira backup (entities.xml) inside of zip file....
This is due to the parent directory being zipped when the XML files were re-compressed after the update.
Attempt the XML restore using the newly created zip file generated above.
Was this helpful?