After upgrade to Confluence 4.3.3 attachments are missing

topher December 5, 2012

We completed the upgrade to 4.3.3 but most of our attachments and imbedded images are now appearing as broken links. I followed the instructions on the Atlassian support site: https://confluence.atlassian.com/display/CONFKB/Resolve+Missing+Attachments+in+Confluence and I have attached the output to this support request.

The attachments are still in subdirectories in the /opt/confluence-data/attachments/ver003 directory, but not in the subdirectories that the script seems to be looking for them. As an example - the report lists the following attachment as missing:

Missing attachment: /opt/confluence-data/attachments/ver003/179/156/12156929/28/170/32670278/33947681/1, filename: CREATE_INSERT_datawarehouse.rpt_JCPL_personIDs.sql, filetype: null

Looking in the /opt/confluence-data/attachments/ver003 directory I find the 33947681 directory:

root@arthur confluence-data # pwd

/opt/confluence-data

root@arthur confluence-data # find ./ -type d -name 33947681

./attachments/ver003/32670278/33947681

root@arthur confluence-data # cd ./attachments/ver003/32670278/33947681

root@arthur 33947681 # ls

1

I have verified that the path currently in place is the same path that works in the previous version of Confluence.

I need some help understanding how we can remap the attachments and images by either updating the metadata or creating the new subdirectories currently identified by the Find Missing Attachments Report.

2 answers

1 accepted

0 votes
Answer accepted
topher December 7, 2012

I had to manually move all of the files from their original location to the location identified by the 'find lost attachments' script.

At a very high level - I took the output of the 'find lost attachments' jsp and put it in a file named 'wiki_missing_files.txt'

Then I stripped out the new filenames with: perl -pi -e 's/Missing attachment: (.*), filename:.*/$1/' wiki_missing_files.txt

Then I created all my directories and copied all the files from the old location (derived from the new location) to the new location:

for i in $(cat wiki_missing_files.txt); do NEWDIR=${i%/*}; OLDPATH1=$(basename $NEWDIR); OLDPATH2=$(basename $(dirname $NEWDIR)); mkdir -p $NEWDIR; cp /opt/confluence-data/attachments/ver003/$OLDPATH2/$OLDPATH1/* $NEWDIR; done

Following all of this I ran the 'find missing attachments' script again and had no missing files.

0 votes
Harry Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2012

Hi, have you tried to re-index Confluence? It was stated in your post. This might solve it. Give it a try first.

topher December 6, 2012

I have rebuilt the indexes (and just did so again); the paths to the attachments are still inaccurate.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events