Hierarchical File System Attachment Storage

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

The way attachments are stored changed significantly in Confluence 3.0.  If you are upgrading from Confluence 2.10 or earlier see Upgrading Confluence for recommended upgrade paths, and read the version of the Hierarchical File System Attachment Storage page in our Confluence 3.0 documentation which provides more detail about migrating to the new file system structure.

Confluence stores attachments, such as files and images, in a file system.  Confluence's attachment storage layout is designed to:

  1. Limit the number of entries at any single level in a directory structure (as some file systems have a limit on the number of files that can be stored in a directory).
  2. Partition attachments per space making it possible for a system admin to selectively back up attachments from particular spaces.

Attachments in Confluence have a number of identifying attributes: content id of the file itself, the space id and content id of the page the file is attached to. This means the file logically belongs to a piece of content which logically belongs in a space (not all content belongs to a space). For files within a space in Confluence, the directory structure is typically 8 levels, with the name of each directory level based on the following algorithm:

level

Derived From

1 (top)

Always 'ver003' indicating the Confluence version 3 storage format

2

The least significant 3 digits of the space id, modulo 250

3

The next 3 least significant digits of the space id, modulo 250

4

The full space id

5

The least significant 3 digits of the content id of the page the file is attached to, modulo 250

6

The next 3 least significant digits of the content id of the page the file is attached to, modulo 250

7

The full content id of the page the file is attached to

8

The full content id of the attached file

9Version number of the file

The modulo calculation is used to find the remainder after division, for example 800 modulo 250 = 50.

Within the 8th level will be a file for each version of that attachment, named to match the version number e.g. 1

An example:

To find the directory where attachments for a particular space are stored, go to <confluence url>/admin/findspaceattachments.jsp and enter a space key. It will return the directory on the file system where attachments for that space are stored.

File D in the above diagram is stored in a slightly different structure. Files that are not conceptually within a space replace the level 2 - 4 directories with a single directory called 'nonspaced'. Examples of such files are the global site logo and attachments on unsaved content.

Last modified on Sep 10, 2017

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.