Is there a solution to automatically backup & restore Confluence?

for Jira i built a script that modifies an existing jiraDBdump:

  • change Hostname
  • change CrowdServerName
  • update License (change to developer)
  • rsync $Jira_Home/data (from productive to backup host)
  • shut down JIRA
  • insert the modified dump into to backup DB
  • start Jira

works as expected.

i want to build something similar for confluence.

can this be done the same way? if i take a look at the sqldump (large file) i can tell it is not that easy and comfortable like it is for jira.

any ideas/suggestions on this one?


2 answers

1 accepted


I am talking from the top of my head, so take this as a guideline more than a procedure.

If you are usig standalone Confluence, this procedure would make sense for me:

  1. Copy data directory
  2. Modify database settings and license in the file <confluence_data>/confluence.cfg.xml
  3. Copy installation directory
  4. Modify location of the data directory in <confluence_install>/confluence/WEB-INF/classes/
  5. Change ports in the file <confluence_install>/conf/server.xml
  6. Restore database dump
  7. Chage Server Base URL in the BANDANA table. Bandana Key is atlassian.confluence.settings and the value is withing the XML.
  8. To avoid problems on startup I would clear the plugin cache.

After that procedure, you should be able to start Confluence. Please remember that I haven't tested this procedure, but I believe that should make it. You can probably simplify it if you use the same paths and ports.

Hi alex. Thanks for participatin. I didn't knew the license could be changed that way. Also i already found the kb article about how to change server base url manually. Is there no other than update the entire xml block?

You could replace the string directly in the DB, many DB servers offer options for replace a string withing a field.

hi alex.

can you please tell me why inside atlassian.confluence.settings the <webdavPassword> is in plaintext?

what is <webdavuser> used for ?

ok i got my script cloning confluence on a backup host now. :)

confluenceSQLdump and data/attachment DIR is synced via cron hourly to the backup host

here are the steps it does:

  1. unzip the dump
  2. stop confluence
  3. insert the dump
  4. execute two queries
    mysql -u&lt;user&gt; -p&lt;pwd&gt; confluence -e "UPDATE cwd_directory_attribute SET attribute_value =  REPLACE(attribute_value, '&lt;old_hostname&gt;' , '&lt;new_hostname&gt;')"
    mysql -u&lt;user&gt; -p&lt;pwd&gt; confluence -e "UPDATE BANDANA SET BANDANAVALUE = REPLACE(BANDANAVALUE, '&lt;old_hostname&gt;', '&lt;new_hostname&gt;') where BANDANACONTEXT = '_GLOBAL' and BANDANAKEY = 'atlassian.confluence.settings'"
  5. sync data/attachments directory
  6. clean plugins cache
  7. start confluence

Thx renjith. I know about cluster license. But at the moment my company is not planing to buy some. Thatswhy i was tryin to create something else

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

915 views 45 7
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