Timezone differences are not taken into account when importing a JIRA Server backup into Cloud.
JIRA backup doesn't seem to store the timezone in entities.xml (check 'Notes' below), so import may shift dates if they are interpreted incorrectly. This happens if the backup exported registered the dates using the timezone used in Jira Server (which seems to happen), while Jira Cloud interpreted as UTC. That makes the times and dates in the UI to be shifted as many hours as the time difference between the instances.
Affected dates are:
- History dates (in 'all' tab in issue view)
- Created date
Apparently, dates like 'sprint start dates' are not affected, as they use a different data type. This is actually even worse because sprints and issues dates may become inconsistent (some are shifted and some are not), breaking reports.
- Create a JIRA Server in a specific timezone different than UTC (database timezone)
- Create tickets and create history (by editing it, adding to sprints, etc.)
- Migrate from this Server to Cloud
- Change your profile timezone in both to match so you can compare
The history dates, created dates, etc. are the same.
The dates are not the same.
In an actual test import, we could see, this was the date as retrieved using a 'select' in Jira Server (source) database:
This was the data in Cloud (destination):
This was what was registered in entities.xml:
No timezone was stored, so Jira Core interprets it as GMT (the Z at the end actually means GMT), though it should interpret as GMT-3 in this case.
There's a 3 hours difference. Though the ticket was created only 1 hour ealier, in the destination it says 4 hours ago (I hadn't even installed Jira 4 hours earlier). If we place the pointer over the date says 09/Mar/18 1:50 PM in source Jira while destination says 09/Mar/18 10:50 AM, though user timezone is the same in both instances (GMT-3).
Notice that this test was done with a recently installed Jira Server (with no advanced configuration) and only 1 project and 2 tickets (a very simple configuration). The destination Jira Cloud was a clean one.
Use either of the workarounds below, not both.
- Check the entities.xml file that was generated.
- Look for lines that look like this:
- The IDs may be the different, but the 'propertyKey' is always going to be jvm.system.timezone, so you can search for it
- If the file contains these lines, you shouldn't be impacted, as a fix was applied to take advantage of it
- If it doesn't, add them next to other OSPropertyEntry and OSPropertyString respectively
- Make sure the ID is not used by other OSPropertyEntry element. If it is, replace both ID (which must be identical) by another unused one.
- In the 'OSPropertyString' entry, make sure you change the value to the timezone from your source Jira.
This only works with PostgreSQL. If you use MySQL you will first need to export the backup and import it into a staging JIRA Server using PostgreSQL.
You may want to take a DB backup before trying this workaround.
- Stop Jira Server
- Change Jira Server timezone, by Setting the timezone for the JAVA environment to UTC
- Alternatively, if the timezone parameter is not being used, you can change the timezone for the server (machine) running Jira Server to UTC
- Start Jira (the User Timezone in System Information page must show the timezone change)
- Notice that this may change most users timezone as well, as Default User Timezone by defaults is set to the system timezone and all users that haven't set their own timezone will use it.
- Generate a new backup and re-do the migration
For further details you can also refer to the below KB (for Jira Server):