Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-38089

Unable to complete import: An invalid XML character (Unicode: 0xffff) was found in the CDATA section

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Trying to import an XML backup into Confluence, we might have the below issue:

      Import failed. Check your server logs for more information. com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: An invalid XML character (Unicode: 0xffff) was found in the CDATA section.
      

      Couldn't find the specific steps to reproduce it but certain XML backups have this issue. This has including been documented here:

      The entities.xml file, and can be fixed by

      1. Unzip the export zip file
      2. Run the below command on the entities.xml file:
        perl -i -pe 's/\xef\xbf\xbf//g' entities.xml
        
      3. Zip up the contents, making sure the root directory has entities.xml

      For Windows Users falling into the 0xFFFF problem - The Perl script and the .JAR File doesn't work for Windows, I couldn't understand the reason yet, however, I created a Power Shell script to fix it. Just run it in the Power Shell ISE or save it as a .PS file and execute it through PS. Here's the script:

      1. Don't forget to change the path of the yourfile entry below to have the PS script picking up the file from the correct place.
      2. Don't forget to change the path of the output file below to have the PS script saving the clean file in the correct place.
        $yourfile = "C:\Users\atlassian\Documents\Horlle\entities.xml"
        $outputfile = "C:\Users\atlassian\Documents\Horlle\entities_clean.xml"
        get-content -path $yourfile | out-file $outputfile -encoding utf8
        

      Attachments

        Issue Links

          Activity

            People

              lgrzyb lukasz
              lmaia Luiz Maia (Inactive)
              Votes:
              20 Vote for this issue
              Watchers:
              43 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: