Backup and restore

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member II

Backup and restore

Hello,

To continue the evaluation of ACS, I tried to backup my server, build another one and restore the data (disaster recovery!). I looked in the procedures and did not find the exact commands to do. So I proceeded by trial and error and I finally go it. That is my process but maybe I'm missing something or I could do it better ?

The database is MYSQL. The root.dir is : /opt/alfresco/

 

Backup :

    • sudo /opt/alfresco/ctlscript.sh stop
    • sudo tar -pczvf backup-alfresco-data.tar.gz /opt/alfresco/apps/alfresco/data
    • sudo tar -pczvf backup-alfresco-mysql.tar.gz /opt/alfresco/mysql/data
    • sudo tar -pczvf backup-alfresco-config.tar.gz /opt/alfresco/apache-tomcat/shared/classes
    • sudo /opt/alfresco/ctlscript.sh start

Copy the 3 files with SFTP to the second server (I use Bitvise SSH)

Restore :

    • sudo /opt/alfresco/ctlscript.sh stop
    • sudo rm -r /opt/alfresco/apache-solr/server/solr/alfresco/index
    • sudo tar -xpzvf backup-alfresco-data.tar.gz -C /
    • sudo tar -xpzvf backup-alfresco-mysql.tar.gz -C /
    • sudo tar -xpzvf backup-alfresco-config.tar.gz -C /
    • sudo /opt/alfresco/ctlscript.sh start

You'll notice that I don't bother to backup and restore the Index and just reset them (it seems logical to reindex after a server crash,).

Also I could do a dumpSQL but that's more commands and the database is small in comparison with the data so I don't bother.

Of course, you must also change the IP adress of the ACS server in the DNS.

That's it, a good backup an a tested restore...

 

 

1 Reply
Professional

Re: Backup and restore

The best procedure is the one that works for you given the context of your environment (servers, people, and processes), so if it works for you, great.

I like to use MySQL dump, and I output the dump into the alf_data directory so that when I TAR up the alf_data directory, it has the appropriate MySQL data in it, all wrapped up in one TAR. You cannot really have a successful restore without both, so why risk the two files getting separated or mis-matched?

As for the config, I don't back it up because I always store all server config in source code control and distribute it to all the servers in my cluster and to each environment (e.g., DEV, TEST, PROD) with Ansible.

That way, whether it is a fresh install or a minor config change, it's always handled the same: Just run the Ansible playbook.