Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Backing up my confluence (latest version)

Elad Dotan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 12, 2015

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 votes
Elad Dotan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 12, 2015

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?

0 votes
chucktalk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 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

0 votes
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 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. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events