Is there a solution to automatically backup & restore Confluence?

C_ Faysal
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.
January 17, 2013

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?

regards

2 answers

1 accepted

4 votes
Answer accepted
Alejandro Conde Carrillo
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.
January 17, 2013

Hi.

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/confluence-init.properties
  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.

C_ Faysal
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.
January 17, 2013
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?
Alejandro Conde Carrillo
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.
January 18, 2013

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

C_ Faysal
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.
January 20, 2013

hi alex.

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

what is <webdavuser> used for ?

C_ Faysal
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.
January 20, 2013

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

1 vote
Renjith Pillai
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.
January 17, 2013
C_ Faysal
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.
January 17, 2013
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
TAGS
AUG Leaders

Atlassian Community Events