This page last changed on Jun 26, 2008 by smaddox.

For either of these procedures, determine where your attachments are stored. The default is the file system.

Attachments will not load

If you find that attachments are listed on the Attachments tab but they cannot be loaded, this means their metadata is still in the database but they do not exist on the file system. To verify this:

  1. Right click on findattachments.jsp and save it to the Confluence server's installation directory under /confluence/admin/
  2. Restart Confluence
  3. Visit http://MYINSTANCE/admin/findattachments.jsp where MYINSTANCE is your Confluence base URL
  4. Request the 'Missing attachment report'

You now have a list of attachment files and locations. From a file system backup, you can recover these files from your <confluence-home>/Attachments directory. Otherwise, there is an attachments directory inside a zipped XML backup in the <confluence-home>/Backups directory. If you have only a SQL dump and the attachments were stored on the database, you will have to restore the SQL dump to get an entire working copy of Confluence in order to recover the attachment.

Attachments have been deleted mistakenly

If a user has deleted an attachment accidentally, its metadata will be gone from the database and the attachment itself will be gone from the file system (or database, if that's where it was stored). This procedure details how to recover a single attachment that's been deleted:

  1. Find the attachments directory from a file system backup or the Attachments folder in an zipped XML backup. The attachments are stored in this format:
    Attachments/<pageID>/<AttachmentID>/<AttachmentVersion>
  2. To find the Page ID, query the database:
    SELECT CONTENTID FROM content WHERE TITLE = '<PageName>' AND PREVVER IS NULL;
    Substitute <PageName> with the name of the page from which your attachment was deleted.
    The returned query is the page ID. If you have few enough attachments there, you can find the appropriate attachment in the corresponding folder under your Attachments folder.
  3. If you still need to know the Attachment ID, you can run the following query:
    SELECT ATTACHMENTID FROM ATTACHMENTS WHERE PAGEID = '<PageID>';
    Substitute the Page ID you got from the query above.
    This will tell you the attachment IDs still attached to this page. Your missing attachment will have an ID not in this list.

findattachments.jsp (application/octet-stream)
Document generated by Confluence on Dec 03, 2008 15:14