Confluence 4.0 : Retrieve file attachments from a backup
This page last changed on Mar 01, 2011 by ggaskell.
File attachments on pages can be retrieved from a backup without needing to import the backup into Confluence. This is useful for recovering attachments that have been deleted by users. Both automated and manual backups allow this, as long as the 'Include attachments' property was set. Users wanting to restore pages, spaces or sites should check out the Confluence Administrator's Guide instead. Before following the instructions for recovering attachments, please review how backups store file and page information. How Backups Store File and Page InformationThe backup zip file contains entities.xml, an XML file containing the Confluence content, and a directory for storing attachments. Backup Zip File StructurePage attachments are stored under the attachments directory by page and attachment id. Here is an example listing: Listing for test-2006033012_00_00.zip \attachments\98\10001 \attachments\98\10002 \attachments\99\10001 entities.xml Inside the attachment directory, each numbered directory inside is one page, and the numbered file inside is one attachment. The directory number is the page id, and the file number is the attachment id. For example, the file \attachments\98\10001 is an attachment with page id 98 and attachment id 10001. You can read entities.xml to link those numbers to the original filename. Entities.xml also links each page id to the page title. Entities.xml Attachment ObjectInside the entities.xml is an Attachment object written in XML. In this example, the page id is 98, the attachment id is 10001 and the filename is myimportantfile.doc. The rest of the XML can be ignored: <object class="Attachment" package="com.atlassian.confluence.pages"> <id name="id">98</id> <property name="fileName"><![CDATA[myimportantfile.doc]]></property> ... <property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">10001</id> </property> ... </object> Entities.xml Page ObjectThis XML describes a page. In this example, the page id is 98 and the title is Editing Your Files. The rest of the XML can be ignored: <object class="Page" package="com.atlassian.confluence.pages"> <id name="id">98</id> <property name="title"><![CDATA[Editing Your Files]]></property> ... </object>
Instructions for Recovering AttachmentsEach file must be individually renamed and re-uploaded back into Confluence by following the instructions below. Choose one of the three methods: Choice A - Recover Attachments By FilenameBest if you know each filename you need to restore, especially if you want just a few files:
Choice B - Restore Files By PageBest if you only want to restore attachments for certain pages:
Choice C - Restore All FilesBest if you have a small backup but want to restore many or all the attachments inside:
|
![]() |
Document generated by Confluence on Sep 19, 2011 02:38 |