Correcting timestamps for Jira issues using XML files
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
After performing a Windows system update, there have been instances where the server's date may change to a point in time in the future.
Within the Jira instance associated with the server where the Windows update occurred, users will see that timestamps will are set to a later date.
Environment
Jira Data Center
Solution
These timestamps in Jira can be corrected by leveraging the XML file generated when using the built-in backup method. First, users will need to generate an XML backup by performing the following steps below to create this file:
Option 2: Use Jira's backup utility
For all of the following procedures, you must be logged in as a user with the Jira system administratorglobal permissions.
To perform a once-off backup, e.g. before an upgrade, follow the steps below.
This section explains how to perform a once-off backup (e.g. before an upgrade). You can also configure scheduled XML backups, as described in Automating Jira application backups.
To do a once-off backup:
In the upper-right corner of the screen, select Administration
> System.
Under Import and export (the left-side panel), select Backup system to open the Backup Jira data page.
Can only create thumbnails for attached images
In the File name field, enter the name of the backup file. Make sure that Jira has the necessary file system permissions to write to this location.
The backup will be stored within the export subdirectory of the Jira application (shared) home directory.
Select the Backup button and wait until your Jira data is backed up. Jira will save your XML backup as a zipped archive file.
When the backup is complete, you’ll see a message confirming that Jira has written its data to the file you specified.
Next, users will then need to navigate to the JIRA_HOME/import directory and where they'll find the ZIP file of the backup. With the ZIP file, users can unzip it to extract the file contents and use their preferred text editor to view the entities.xml file.
⭐ For example, here's a snippet of issue SCRUM-9 where we can update various timestamp fields, such as created and updated:
1
<Issue id="10008" key="SCRUM-9" number="9" project="10000" reporter="admin" creator="admin" type="10001" summary="As a developer, I'd like to update story status during the sprint >> Click the Active sprints link at the top right of the screen to go to the Active sprints where the current Sprint's items can be updated" priority="3" status="10000" created="2021-03-31 12:01:06.758" updated="2021-03-31 12:01:06.758" votes="0" watches="0" workflowId="10008"/>
An easy way to perform this would be to use a Find and Replace method which are generally available in modern text editors.
Once complete, the files can be saved and zipped back up and then users can use the restore Jira from a backup method:
2. Restore the XML data
From the top navigation bar select Administration
> System.
Select Import & Export > Restore System to open the Restore Jira applications data from Backup page.
In the 'File name' field, type the file name of the zipped XML backup file generated by Jira.
Ensure that this backup file has been moved or copied to the location specified below this field.
The Index Path field indicates where Jira will restore the search index data from the zipped XML backup file. This location (which cannot be modified) matches the index path specified in the zipped XML backup file. If, however, this backup file does not specify an index path, Jira will restore the search index to the caches/indexes subdirectory of the Jira application home directory.
Please Note:
The contents of the index directory may be deleted by the restore process.
The index directory should only contain Jira index data.
5. Click the 'Restore' button and wait while your Jira data is restored.
Once the data has been restored, Jira will inform you that you have been logged out. This happens because all Jira users which existed in Jira prior to Jira's data being restored will have been deleted and replaced by users stored in the Jira export file.
It is recommended that you avoid passing through a proxy when performing an XML restore, especially if your Jira instance is very large. Using a proxy may cause timeout errors.
⚠️ Be sure to test thoroughly before pushing to a Production environment as this is not a supported method.
Was this helpful?