Production Backup Strategy
Although Confluence can provide a scheduled XML backup, this backup method is only suitable for small sites, test sites, or in addition to database and directory backups.
Since Confluence 8.3, we have changed the way we do backup and restore. Learn more about these changes in the Confluence 8.3 Release Notes.
Scheduled backups don't use this new approach; it still uses our legacy system. We recommend you stop using scheduled backups unless required because it contains many of the issues resolved in the new system.
Establishing a production system backup solution
We recommend establishing a robust database backup strategy:
- Create a backup of your database using the tools provided by your database. If your database doesn't support online backups, you will need to stop Confluence while you do this.
Create a copy of your home directory (both local home and shared home for Data Center).
If Confluence is configured with OpenSearch, create a snapshot of your OpenSearch indices.
Once this is in place, you can disable any scheduled backup job you have set.
Having a backup of your database, home directories, and OpenSearch indices is more reliable and easier to restore than a large XML backup.
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>/confluence.cfg.xml
- <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. Note: This is only necessary if your Confluence instance is configured with Lucene (default). See the section below if you use OpenSearch.
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:
- Windows
C:\Program Files\Atlassian\Application Data\Confluence
- Linux
/var/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:
- <conf-home>/thumbnails
- <conf-home>/viewfile.
How do I back up my database?
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 my database?
Our guide on Migrating Confluence between servers has instructions on restoring a backup using this technique.
How do I take a snapshot of my OpenSearch indices?
If your site is large, reindexing can take a long time. Taking snapshots of your OpenSearch indices will avoid the need for a full reindex when restoring.
Other processes
XML site backups can be used for other processes in Confluence, for example moving servers or switching to a different database. Using the backup strategy described above will work for those processes too.
- Our migrate server procedure, which is used to set up a test server, can use a SQL dump as well.
- The database migration procedure uses the XML backup. You could also use third-party database migration tools.
If you would like help selecting the right migration tools, or help with the migration itself, reach out to one of our Atlassian Solution Partners.