Export Assets Objects with attachments

Chantale Simard November 22, 2024

Hi,

I have a client that dropped all objects of a certain type in assets.

We did a restore of the database on a staging environment, reinstalled Jira and I was able to export the data to reimport it in production.

Unfortunately, the attachements did not follow.

Is there any way I can achieve this ?

Thanks.

1 answer

0 votes
Sandeep January 28, 2025

You're facing a common challenge with Jira restores – attachments often don't get included when you restore just the database. Here's a breakdown of how to handle this:

1. If You Have the Original jira-home Directory:

This is the best-case scenario. If you have a backup of the jira-home directory from before the objects were deleted, you can restore the attachments directly.

  • Procedure:
  1. Shut down your staging Jira instance.
  2. Replace the data/attachments directory within your staging instance's jira-home with the data/attachments directory from your backup.
  3. Restart Jira.

2. If You Only Have the Database Backup:

This is more complex. The database only stores metadata about the attachments (filename, size, etc.), not the files themselves. You'll need to find the actual attachment files.

  • Possible Locations:

  • Backup of the jira-home directory (even an older one): Even if it's not from right before the deletion, it might contain some of the attachments.

  • File system backups: Check if your server backups include the jira-home directory.

  • Network shares: If Jira was configured to store attachments on a network share, check there.

  • Procedure (if you locate the files):

  1. Organize the attachment files in a structure that mirrors the data/attachments directory. The subdirectories within attachments are typically hexadecimal hashes. You might need to examine the database to figure out the correct paths (the file_attachment table might have clues).
  2. Copy the organized attachment files into the data/attachments directory of your staging Jira instance.
  3. Restart Jira.

3. If You Have Neither jira-home nor the Files:

This is the worst-case scenario. Recovery is very difficult, and you might need to consider data recovery services.

  • Possible (but difficult) approaches:
  • Database forensics: If the attachments were stored in a BLOB field in the database (unlikely in standard Jira), a specialist might be able to recover them.
  • Contact Atlassian Support: They might have additional suggestions, but full recovery is unlikely without the files.

Important Considerations:

  • Staging Environment: Always work on a staging environment first to avoid further issues in production.
  • Backups: This situation highlights the critical importance of regular and complete Jira backups (both database and jira-home).
  • Attachment Storage: Review your Jira attachment storage configuration. Storing attachments outside of the jira-home directory (e.g., on a network share or cloud storage) can simplify recovery in some cases.

If you have a partial jira-home backup or file system backups, you might be able to recover some of the attachments. The key is to locate the actual attachment files and place them in the correct location within the data/attachments directory. If you're unsure, consult with an Atlassian expert.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events