Jira docker commit doesn't preserves the changes

bkalai October 19, 2018

I  did the following:

  • backed up our production database (MySQL)
  • Backed up the Jira server using the native backup
  • Restored  the database back to a new RDS instance
  • ran docker run -d --name jira -v /home/ec2-user/jiravolume/host:/var/atlassian/jira/host_data -p 8080:8080 dchevell/jira-software as one can see i don't use the volume as my JIRA_HOME directory
  • I entered the container using exec
  • using config.sh setup the home directory
  • using config.sh setup the database connection as well as test the connection
  • I connected to the server using  port 8080 and got to the initial setup page
  • I selected setup my server and in database used the demo (H2).
  • once the demo database was installed i verified that dbconfig.xml was still pointing to my RDS MySQL. 
  • I then did a restore from the zip file on the application server container.
  • once the restored completed I was able to logon to Jira and made a few modifications to the setup
  • I ran docker commit with a new tag
  • I removed the old container and ran a new container based on the commited image but was redirected  to the setup  page again. I stopped and started the container during setup with no problem but once i tried to spin a fresh containers all changes disappeared
  • What am I doing wrong?

1 answer

1 accepted

0 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 22, 2018

Curious if perhaps after you made the changes to the dbconfig.xml if you then restarted Jira.   If you did NOT, then that would explain this behavior.  Changes to that file have to be saved and Jira has to be restarted for those changes to take effect.   If you did not restart jira, then the import actually went into the H2 database, and not the expected MySQL database.   But to confirm that, I'd want to look closer at the $JIRAHOME/log/atlassian-jira.log file, particularly at the time of this import/restore.

 

When you are restoring data in Jira using the XML backup, I typically don't recommend using the method in the system administrator menus.  Instead, I have found it is better to setup an empty database (since this process is going to overwrite any data anyway in the database Jira is connected to) and the use the setup wizard in Jira and select the option to 'import existing data'.  This works in much the same way, but the major difference here is that this method can still perform Jira upgrade tasks (whereas restoring an xml backup in the system admin menu after Jira is setup cannot).  That doesn't matter if you're importing a backup from the exact same Jira version, but is essential if your backup comes from an older version of Jira.

 

Even if my hunch here is incorrect, looking at the log files when Jira was restoring this data would probably be were I would start if you did indeed restart Jira after changing the dbconfig.xml file. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events