XML restore fails with message "The processing instruction target matching "[xX][mM][lL]" is not allowed"

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

Symptoms

While restoring an XML backup it errors out and the following appears in the atlassian-jira.log:

1 2 3 4 5 6 2013-10-22 09:55:30,988 JiraImportTaskExecutionThread-1 INFO admin 595x49x1 16ilmkn 127.0.0.1 /secure/admin/XmlRestore.jspa [jira.bc.dataimport.DefaultDataImportService] Start parsing XML with SAX Parser. [Fatal Error] :1:7: The processing instruction target matching "[xX][mM][lL]" is not allowed. 2013-10-22 09:55:31,048 JiraImportTaskExecutionThread-1 ERROR admin 595x49x1 16ilmkn 127.0.0.1 /secure/admin/XmlRestore.jspa [jira.bc.dataimport.DefaultDataImportService] Error parsing export file: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed. org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) ...

Also, the following appears on the screen:

(Auto-migrated image: description temporarily unavailable)

Cause

The XML backup can't start with blank spaces. According to the XML spec, you can't have anything at all before the XML prolog. Since we use XML declaration, the entities file must start with:

1 <?xml version="1.0" ...

In some cases, non-printing characters like the byte order mark (BOM) can cause trouble by taking up the first few bytes of a file.

Resolution

  1. Decompress the backup file;

  2. Open the entities.xml file in a text editor and remove anything blank space or any character in front of the following statement:

    1 <?xml version="1.0" ...
  3. Compress the backup file again and restart the XML restore.

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.