Backing up my confluence (latest version)

Hi, 

I want to make sure my server is completely backed up.

this is what I do:

  1. schedule a daily backup of my site to  /var/atlassian/application-data/confluence/backups (in conlfuence administrator)
  2. I have the following script that will also backup data and my mysql scheme.

This is the script:

#!/bin/bash -x
CNFL=/var/atlassian/application-data/confluence
CNFL_BACKUP=/home/cnflBackup/`date +%Y%m%d-%H%M%S`

rm -rf $CNFL/temp/*
mkdir $CNFL_BACKUP
mysqldump --defaults-file=~/.my.conf confluence |gzip > $CNFL_BACKUP/confluence.mysql.data.gz
tar -cjvf $CNFL_BACKUP/data.bzip $CNFL > $CNFL_BACKUP/homedir.status
[root@CentOS-7 elad]# cat backup.sh 
#!/bin/bash -x
CNFL=/var/atlassian/application-data/confluence
CNFL_BACKUP=/home/cnflBackup/`date +%Y%m%d-%H%M%S`

###rm -rf $CNFL/temp/*
mkdir $CNFL_BACKUP
mysqldump --defaults-file=~/.my.conf confluence |gzip > $CNFL_BACKUP/confluence.mysql.data.gz
tar -cjvf $CNFL_BACKUP/data.bzip $CNFL > $CNFL_BACKUP/homedir.status

 

  • am I missing anything?
  • the files and folders I backup in Confluence "backup Administration" is the same as my script?
  • /var/atlassian/application-data/confluence - is the folder I want to backup?
  • what about backing up /opt/atlassian/confluence ? do I need to backup this one as well?

 

 

 

3 answers

0 vote
Timothy Chin Community Champion Apr 12, 2015

Everything looks good. There are some configurations in /opt/atlassian/confluence/confluence/WEB-INF/classes that you may want to consider backing up if they have been modified. 

0 vote
Chuck Talk Atlassian Team Apr 12, 2015

Hi Elan,

The preferred method is to us the Production Backup Strategy, which is to use the native backup tools provided by your database, as below:

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
    warning 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>/confluence.cfg.xml
  • <conf-home>/attachments

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:

  • 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. 

I do hope this information is helpful to you.

Sincerely,

Chuck Talk | Confluence Support
Atlassian

what about backing up /opt/atlassian/confluence ?

I also edited server.xml and web.xml - don't we need to backup these files and folders?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

709 views 21 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you