How to restore deleted Assets (Insight) object types or objects in Jira Data Center
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Purpose
You might have mistakenly deleted an Assets Object Type when you just wanted to delete one Assets Object — it happens.
However, it's not possible to restore a deleted Assets object or an object type or redo the deletion. We have a Suggestion ticket JSDSERVER-8650 - Introduce dedicated backup / restore functionality for Insight open for future implementation.
This KB is to outline a few possible ways to retrieve the deleted data.
Solution
1. Restore from backup (XML or DB)
Restore Jira data from XML or database backup. This ensures that the deleted Assets data is completely recovered.
This completely overwrites Jira application data and hence, any update made after the backup is made will be lost.
2. From another instance
If you have another Jira instance where the deleted data can be extracted, you could import it to the current instance via CSV import or object schema import.
You should also note that any other schema or object type related configurations like import configurations, automations, roles etc will not be imported via Object Schema import.
Imports create objects from scratch, new object keys will be created and object history will be overwritten. This also means that if a deleted object was connected to a Jira issue, the "restored" object will not be automatically connected as the link between objects and Jira issues will not be imported.
3. Restoring only Assets DB tables
Restore only Assets-related database tables from your database backup that contains the Assets data to be recovered, using database native function to copy or migrate the data. All Assets-related database tables have the prefix of AO_8542F1.
Please note Atlassian does not provide support to restore the data this way, as different database types with different versions may have different ways to copy data from one database to another. We recommend engaging your DBA to determine the best way to copy between databases.
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Assets tables have Foreign Keys to one another (all within the AO_8542F1_* "domain") so the order of deletes and restores is important. Here's an example of the order the 57 AO_8542F1 tables can have their records deleted and restored as of JSM 5.12:
4. Restoring Custom fields
If you've decided to restore only the schema or the Assets tables (options 2 or 3), then custom fields that had references to the deleted schema will not recover their references.
To solve this, please refer to the guide at How to restore a deleted custom field in Jira. Even though the custom fields themselves were not deleted, this page will help with the procedure to recover the values from before the deletion.