Production Backup Strategy
Confluence automatic daily XML backup is suitable if you:
- are evaluating Confluence
- do not have database administration familiarity, and your Confluence installation is small
Once your Confluence installation reaches more than a few thousand pages, the XML backup facility can be inefficient compared to your database's own backup tools. The built in backup functionality requires a lot of memory to run and is less reliable when restoring data.
Establishing a production system backup solution
Atlassian recommends establishing an alternative database backup strategy:
- Create a backup or dump of your database using tools provided by your database
To avoid any data inconsistency and corruption, it is recommended to shut down Confluence before creating a database backup or dump.
- Create a file system backup of your Confluence home directory
- Create a file system backup of your shared home directory (Clustered instances only)
Once this is in place, disable the daily backups through the scheduled jobs feature via 'Administration Console > Administration > Scheduled Jobs'.
We want to stress that creating these two backups is better than having a Confluence XML backup. It is more robust and far more reliable for large production instances. You will be able to restore your whole site, including all data, attachments and configuration information intact with these two backups. See Restoring Data from other Backups.
Which files need to be backed up?
Backing up the whole home directory is the safest option, however most files and directories are populated on startup and can be ignored. At minimum, these files/directories must be backed up:
- <conf-home>/attachments (you can exclude extracted text files if space is an issue)
The rest of the directories will be auto-populated on start up. You may also like to backup these directories:
- <conf-home>/config – if you have modified your ehcache.xml file.
- <conf-home>/index – if your site is large or reindexing takes a long time – this will avoid the need for a full reindex when restoring.
The location of the home directory is configured on installation and is specified in the
confluence.init.properties file. For installation created with the automatic installer the default locations are:
C:\Program Files\Atlassian\Application Data\Confluence
For Clustered instances only: Backing up the whole shared home directory is the safest option, however some files and directories are populated at runtime and can be ignored:
How do I back up?
The commands to back up your database will vary depending on your database vendor, for example the command for PostgreSQL is
pg_dump dbname > outfile.
You should refer to the documentation for your particular database to find out more.
How do I restore?
Our guide on Migrating Confluence Between Servers has instructions on restoring a backup using this technique.
XML backups are described and used for other processes in Confluence, like upgrading and moving servers. Using the backup strategy described above will work for those processes too.
- Our upgrade guide does not require the use of an XML backup (although the earlier Confluence upgrade procedure, and the JIRA upgrade guide, do use XML backups).
- Our migrate server procedure– used to set up a test server – can use a SQL dump as well.
- The database migration procedure uses the XML backup for small data sets. Large data sets will require third party database migration tools.