A note on migrating an old Jira install to Jira cloud

One part of the migration of my old setup to kubernetes is the migration of an old Jira 6.1 instance. Unfortunately, running that same jira instance in a container did not work because of licensing issues, and apparently it is impossible to get new licenses for such an old jira instance. Also it seems no longer possible to run Jira at home for open source projects and only cloud hosting may be used. A prerequisite for what follows is that you have a cloud instance of Jira running at atlassian cloud with a valid license (open source or commercial). The description is not exhaustive and you will need atlassian documentation and support to get the full picture, but this post tries to describe some of the essential steps in the migration.

Untortunately migrating directory from such an old Jira instance to Jira cloud is impossible and must be done in steps.

Instead, a sequence of intermediate updates must be used as described on the internet. This requires upgrading Jira from 6.1 to the minimum required version for cloud migration which is 7.6. This involves the following upgrade path: 6.1, 6.4, 7.0, 7.1, and finally 7.6. Luckily, it is easy to run Jira using docker-compose. The compose file I used was as follows:

services:
  jira64:
    image: ahaasler/jira:v6.4.13
    ports:
      - "8084:8080"
    environment:
      PASSWORD: abc123
    volumes:
      - /data/jira6.4:/data/jira

  jira70:
    image: ahaasler/jira:7.0.11
    ports:
      - "8070:8080"
    volumes:
      - /data/jira7.0:/data/jira

  jira71:
    image: ahaasler/jira:7.1.10
    ports:
      - "8071:8080"
    volumes:
      - /data/jira7.1:/data/jira
      
      
  jira76:
    image: eugenmayer/jira:en-7.6.3
    ports:
      - "8076:8080"
    volumes:
      - /data/jira7.6:/var/atlassian/jira
       
  jira713:
    image: eugenmayer/jira:en-7.13.1
    ports:
      - "8713:8080"
    volumes:
      - /data/jira7.13:/var/atlassian/jira
      - ./server.xml:/opt/jira/conf/server.xml

Using this setup an individual Jira version can be run as follows:

docker-compose run --service-ports jiraVERSION

Note that I also used jira 7.13 because there was an issue moving jira 7.6 to the cloud because the correct cloud product was not installed. This was not actually a problem with Jira 7.6. It was caused by a missing Jira Software product in the cloud environment.

Each migration step is then similar and goes as follows:

  • Export the jira data by logging in a admin and then exporting using System/IMPORT AND EXPORT/Backup system.
  • Retrieve the backup from the export directory of the jira install and copying
    it to the import directory of the next jira version. Also give read access for all users after copying the file (chmod 644 ….)
  • Retrieve a new trial licence from atlassian.
  • Startup the new jira instance, and choose the manual import. Make sure to use the built-in database H2 (this avoids having to configure an external database instance). Use the trial license to startup the instance.
  • Import the jira export from the previous install using System/IMPORT AND EXPORT/Restore system. In the latest versions of Jira it required a bit of fiddling to end up in this step without first setting up a new default project.

The last step for moving Jira to the cloud is special and requires the cloud assistant functionality running in the local jira instance (docker-compose). Apparently, the local jira instance redirects you to your cloud instance, which then connects back to your local instance to retrieve data. At least that is how I think it works. It therefore requires the Jira instance to be hosted under an external domain name. So this requires a setup of proxying the external domain name to the local jira instance.

In apache this setup was as follows:

<VirtualHost *:80>
  ServerName localjira.example.com

  ProxyPreserveHost on
  ProxyRequests off
  RequestHeader set "X-Forwarded-Proto" https
  RequestHeader set "X-Forwarded-Port" 443
 
  <Proxy *>
         Require all granted
  </Proxy>

  ProxyPass / http://LOCALIP:8713/ disablereuse=On
  ProxyPassReverse / http://LOCALIP:8713/

</VirtualHost>

Unfortunately, this setup is not sufficient for Jira and some additional configuration must be done by editing the server.xml file which is inside the container. The server.xml is obtained by copying it from inside the running
container and then making sure the connector definition is as follows:

<Connector port="8080" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
                   maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false"
                   maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443"
                   acceptCount="100" disableUploadTimeout="true" bindOnInit="false" secure="true" scheme="https"
                   proxyName="localjira.example.com" proxyPort="443"/>

The import flags are here the secure and scheme flags. It is a bit unfortunate that
jira does not understand the X-Forwarded-Proto and X-Forwarded-Port headers that are sent by apache.

After this the atlassion instructions for migrating jira to a cloud instance can be used and in case of problems I found the atlassian support to be really helpful.

The Jira 6.1 instance that was running on my old OpenSuSE 11.3 server from 2010 is now running in the atlassian cloud. It can be found here. I also setup redirects to the cloud environment  so that any old links to issues on my old Jira 6.1 instance will keep on working.

This entry was posted in Devops/Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *