Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira migration from Cloud to Server is failing due to Incorrect string values

Atlassian Products
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 7, 2018

I am currently working on trying to merge a JIRA cloud instance to a JIRA Server instance. I know at this time that you are unable to perform project imports from total backups form Cloud to Server. Documentation seems to say that we are able to perform full restorations from Cloud to Server. So In order to perform the merge my current workflow looks like:

 

Get JIRA cloud backup > Do full instance restore on blank JIRA SERVER > Make a backup of JIRA server restored copy of JIRA cloud. > Export the restored JIRA server > then use the backup file to import projects one by one onto production JIRA completing the merging of two instances.

 

I have spun up a blank instance of JIRA Server and attempted to load in the backup generated from the JIRA Cloud instance. I ran into a few errors. One being that the KEY is missing about 2-3 weeks ago it looks like the instances stopped using the key variable. I followed some work arounds to also clean up the entities.xml using the atlassian-cleaner.jar thing. At this time I am at a stump attempting to restore using MySQL and PSQL databases.

 

As far as I can see using the HSQLDB i did not get an error how ever I cannot login because the users from the original instance does not have me. I have since added my self in place however there is an atlassian error not allowing me to register my account to the cloud server saying "This action took too long to perform"

I cannot create a local admin user without some kind of invitation. I do know a user on there that is listed as a Admin but I don't have its password and cant seem to make a connection to the HSQL DB to hack my way into authentication.


 

{code}

Unexpected error occurred during import: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue][summary,API-Proxy Load balancing issue][watches,2][creator,nag.angadi][created,2015-10-06 10:11:23.334][project,10002][description, Check the attachement for details Elastic Beam Mail Nag Angadi <nag.angadi@somerandomcompany.com> API-Proxy Load balancing issue 9 messages Nag Angadi <nag.angadi@somerandomcompany.com> Mon, Oct 5, 2015 at 12:43 PM To: Anoop Krishnan <anoop@somerandomcompany.com>, Uday Subbarayan <uday@somerandomcompany.com> Cc: eng-proxy <eng-proxy@somerandomcompany.com> Hi Anoop, Here the details of the problem I discussed in the meeting. Test Set up: 1.API -proxy running on vertex-1 2.HAProxy server running on Vertex-2 3.Webserver running on vertex-5 VirtualHost-1 Running on Port 80: Simple HTML page-displays "Success: You Have Set Up a Virtual Host-1" (Refer the attached image) VirtualHost-2 Running on Port 8080: Simple HTML page-displys "Success: You Have Set Up a Virtual Host-2" (Refer the attached image) 4.Virtual hosts do not use cookies/set cookies. 5.Load generating script running on Vertex3 Execute the script load.sh on vertex3 and check the output. ex: ./load.sh <Proxy server IP> <No of requests to send> Test 1: Sending web load to API-Proxy: root@vortex3 ~/nag 23:53:04 $ ./load.sh 192.168.1.111 1500 500 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 1000 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> Test 2: Sending web load to HAProxy: root@vortex3 ~/nag 23:54:46 $ ./load.sh 192.168.1.112 1500 750 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 750 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> root@vortex3 ~/nag 23:54:59 $ Observe that traffic was served by both the virtual hosts evenly '1:1' in case of HAProxy (Roundrobin) whereas it is uneven in the ration of 2:1 in case of APIProxy Check the attached image,config for more details. Web pages: Inline image 1 Test results: Inline image 2 API-Proxy Config: Inline image 3 HAProxy Config: Inline image 5 Thanks Nag Anoop Krishnan <anoop@somerandomcompany.com> Mon, Oct 5, 2015 at 1:12 PM To: Nag Angadi <nag.angadi@somerandomcompany.com> Cc: Uday Subbarayan <uday@somerandomcompany.com>, eng-proxy <eng-proxy@somerandomcompany.com> Hello Nag , I just tested your set up and it works correctly for me , Please see the screenshots attached. I have used a new script to generate load. Script content : #!/bin/bash for i in {1..5000} do curl http://192.168.1.111/ done This will generate 5000 request hitting the vortex-1 API-Proxy machine from vortex-3 (script is there in /root/anoop/loadgen.js) . I have done grep for "Host-1" and "Host-2" and it gave me 2500 each. Please find the commands and outputs below. [root@vortex3 anoop]# ./loadgen.js > load.log 2>&1 & [1] 11330 [root@vortex3 anoop]# ls loadgen.js load.log [root@vortex3 anoop]# [1]+ Done ./loadgen.js > load.log 2>&1 [root@vortex3 anoop]# [root@vortex3 anoop]# cat load.log | grep -i Host-2 | wc -l 2500 [root@vortex3 anoop]# cat load.log | grep -i Host-1 | wc -l 2500 Generated a load of 5000 Request and got 2500 for server1 and 2500 for server2. Please find the screenshot below. Inline image 1 Regards, Anoop Krishnan G Elastic Beam Inc. [Quoted text hidden] -- Regards, Anoop Krishnan G ElasticBeam Inc Nag Angadi <nag.angadi@somerandomcompany.com> Mon, Oct 5, 2015 at 4:34 PM To: Anoop Krishnan <anoop@somerandomcompany.com>, Uday Subbarayan <uday@somerandomcompany.com> Cc: eng-proxy <eng-proxy@somerandomcompany.com> Ok. strange behavior. Did u restart API-Proxy server?. Just wondering, any changes made to he proxy server? Even it is working for me now. 😕 root@vortex3 ~/nag 01:29:35 $ ./load.sh 192.168.1.111 1500 750 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 750 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> root@vortex3 ~/na g 01:30:12 $ ./load.sh 192.168.1.111 1500 750 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 750 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> root@vortex3 ~/nag 01:30:26 $ I have tested it 10/12 times before rising this issue. I still have the logs. root@vortex3 /tmp 03:17:43 $ for i in 1444025774.log 1444025814.log 1444025908.log 1444026046.log 1444027377.log 1444027436.log 1444027441.log 1444027443.log 1444027446.log 1444027521.log curl-1000Req.log curl-1000Req-Haproxy.log; do grep 'Virtual Host' $i | sort | uniq -c; done; 333 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 667 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 334 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 666 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 333 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 667 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 333 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 667 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 4 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 6 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 3 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 7 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 3 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 7 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 4 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 6 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 5 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 5 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 50 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 50 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 333 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 667 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> 500 <h1>Success: You Have Set Up a Virtual Host-1 on 115</h1> 500 <h1>Success: You Have Set Up a Virtual Host-2 on 115</h1> root@vortex3 / Thanks Nag [Quoted text hidden] Anoop Krishnan <anoop@somerandomcompany.com> Mon, Oct 5, 2015 at 4:39 PM To: Nag Angadi <nag.angadi@somerandomcompany.com> Cc: Uday Subbarayan <uday@somerandomcompany.com>, eng-proxy <eng-proxy@somerandomcompany.com> Hi Nag, Yes , i deleted the logs and data folder and did a clean start. There is two possibilities which can caused this in your previous test . 1. Previous cookie in memory (If there was cookie learning enabled) 2. There was some stray requests from other source like browser (Favicon request , browser may keep requesting this) while your test was running. Regards, Anoop Regards, Anoop Krishnan G [Quoted text hidden] Anoop Krishnan <anoop@somerandomcompany.com> Mon, Oct 5, 2015 at 4:40 PM To: Nag Angadi <nag.angadi@somerandomcompany.com> Cc: Uday Subbarayan <uday@somerandomcompany.com>, eng-proxy <eng-proxy@somerandomcompany.com> There was no change for build , only deleted the log and data folder. Regards, Anoop [Quoted text hidden] Nag Angadi <nag.angadi@somerandomcompany.com> Mon, Oct 5, 2015 at 4:53 PM To: Anoop Krishnan <anoop@somerandomcompany.com> Cc: Uday Subbarayan <uday@somerandomcompany.com>, eng-proxy <eng-proxy@somerandomcompany.com> OK. Cool, restarting the proxy must have resolved the issue. I think it is bug, some set of actions lead to this condition/state of APIProxy. Anyways I will keep tab on this issue and also try to find the root cause for this. Thanks Nag [Quoted text hidden] Anoop Krishnan <anoop@somerandomcompany.com> Mon, Oct 5, 2015 at 5:15 PM To: Nag Angadi <nag.angadi@somerandomcompany.com> Cc: Uday Subbarayan <uday@somerandomcompany.com>, eng-proxy <eng-proxy@somerandomcompany.com> Hi Nag, i dont think restarting solved this issue , i encountered this issue when i was testing in my local , that time browser was sending the favicon request without my knowledge while i was doing the load test and this gave me weird output. Next time before testing please check whether any request is coming to port 80 using tcpdump after that please start the test. Please keep track of this bug and let me know if u see this anytime. Regards, Anoop [Quoted text hidden] Uday Subbarayan <uday@somerandomcompany.com> Mon, Oct 5, 2015 at 9:13 PM To: Anoop Krishnan <anoop@somerandomcompany.com> Cc: Nag Angadi <nag.angadi@somerandomcompany.com>, eng-proxy <eng-proxy@somerandomcompany.com> Hi Anoop/Nag, Pl file a JIRA. I want to take a close look at it when I am back. As I keep saying that "consistency + stability" important for our success in this L7 domain. Thanks, Uday. [Quoted text hidden] Nag Angadi <nag.angadi@somerandomcompany.com> Mon, Oct 5, 2015 at 9:27 PM To: Uday Subbarayan <uday@somerandomcompany.com> Cc: Anoop Krishnan <anoop@somerandomcompany.com>, eng-proxy <eng-proxy@somerandomcompany.com> Hi Uday, I will file a JIRA ticket. Thanks Nag [Quoted text hidden]][reporter,nag.angadi][type,1][priority,3][resolution,10000][number,56][resolutiondate,2018-01-15 07:23:00.664][votes,0][id,11903][assignee,anoop][updated,2018-01-15 07:23:00.692][workflowId,11903][status,10002] (SQL Exception while executing the following:INSERT INTO jiraissue (ID, pkey, issuenum, PROJECT, REPORTER, ASSIGNEE, CREATOR, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Incorrect string value: '\xF0\x9F\x98\x95\x0A\x0A...' for column 'DESCRIPTION' at row 1))

{code}

Without running the java-clean script i get the following error when attempting a full restoration: 

 

{code}

There was a problem parsing the backup XML file at /var/atlassian/application-data/jira/import/clean.zip: No 'key' field for Issue 22354.

{code}

 

Links with additional information to problems I am encountering on my endeavor.
https://jira.atlassian.com/browse/ID-6332

https://confluence.atlassian.com/jira/removing-invalid-characters-from-xml-backups-12079.html

https://jira.atlassian.com/browse/JRACLOUD-66788

1 answer

0 votes
Andy Heinzer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 8, 2018

Please don't use the HSQL database that comes included with Jira Server.   It's prone to data loss, it's not supported by Atlassian, and it has other potential issues with data integrity.  It's really only good for evaluations.   I would not recommend ever migrating Jira Cloud data directly to a Jira site using the HSQL database on the backend.   From reading your description of your currently problem, I can't help but think that it is very likely your Cloud to Server restore did not complete to 100%.  In turn this could cause the latest error you are seeing now of "No 'key' field for Issue 22354" as well as explain why you can't login to Jira after the restore.   You should be able to login to with the username/password of sysadmin/sysadmin for any Cloud backup restored to Jira Server.  

Basically I think that your first restore is actually failing somewhere and the subsequent backup created from this Jira Server site is corrupted fragments of your Cloud backup data.   To confirm or deny this theory, go into the $JIRAHOME/log/atlassian-jira.log file and look for the log entries that show the initial import of that Cloud backup.  You can search for these by searching for strings like '1%', '2%', etc.  When importing data like this, you should have 100 entries in the log for all the values between 1% and 100%.  If your restore did not make it to 100% before generating an error or Jira restarting, your restore did not import all your Cloud data.   

It's better to use a supported database from the supported platforms page.   I would recommend completing this step once more for restoring the Cloud backup to a fresh Jira Server install.  I would also suggest selecting a postgres database, but the choice is yours.

 

The next fun fact, is that MySQL does not support 4-byte characters, which you appear to have found out already.  This is a well known limitation that is documented in the supported platforms page, and in the Connecting jira to mysql database guide.

All Jira Cloud backups come from Postgresql databases that don't have this particular problem.  One way to avoid this is to use another database on the backend of Jira such as postgresql or Microsoft SQL.   If you're still set on using MySQL, check out workarounds on https://jira.atlassian.com/browse/JRASERVER-36135 There are other users that have tried out using the utf8mb4 character set when creating the MySQL database for Jira.  While this is not official supported by Atlassian yet in Jira, it does appear to offer a way to let MySQL store those characters.  

Otherwise if you're going to be importing data that came from a postgres instance into a database using MySQL, you are going to have to run that utility to strip out these 4 byte characters.   I have had success in the past using that utility.   For me it has never generated the error you have now.   

So in my opinion, this first Server backup taken really is corrupted from that first restore, and the invalid characters are being removed correctly by the script, you just have missing entries because the first restore only partially completed.

Sorry this post turned into a book.  Let me know if you have any questions/concerns about next steps to try here.

Suggest an answer

Log in or Sign up to answer