Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete attachment references from Database

matt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2023

We copy our Production Jira and Confluence down to a Development environment. We do not copy attachments because we do not need them there.

I am looking for a database query to delete all the attachment references in the database, to avoid errors in logs when re-indexing both Jira and Confluence because it cannot find the attachment.

1 answer

1 accepted

0 votes
Answer accepted
Florian Bonniec
Community Champion
August 21, 2023

Hi @matt 

 

For JIRA it's in this table and should be returned by the query below.

select fa.id, fa.filename, ji.issuenum from fileattachment fa join jiraissue ji on ji.id = fa.issueid join project p on p.id = ji.project where p.pkey = 'PRG';

Locate Jira server file attachments in the filesystem | Jira | Atlassian Documentation

For Confluence this KB should help you.

How do I list all attachments in Confluence with their location and file sizes? | Confluence | Atlassian Documentation

Regards,

Suggest an answer

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

Atlassian Community Events