AnsweredAssumed Answered

Backup and Restore Procedures

Question asked by art99trash on Apr 29, 2016
Latest reply on Jul 20, 2017 by bruno.oliveira
I am trying to create backup and restore procedures for an Alfresco Community 5.1.0 system.

After reading Alfresco documentation and forums I created the procedures listed below.

I installed a new Alfresco system, created a new (non-admin) user and a new Site.

I then followed these steps to backup and restore the system. (After backing up the system, I uninstalled it.

The restored system runs but the non-admin user and the Site are not there.

Can anyone point out flaws in these procedures?


Alfresco backup
1. cd /opt/alfresco-community
2. ./ stop                                 // stop Alfresco
3. ./ start postgresql               // start postgresql
4. /opt/alfresco-community/postgresql/bin/pg_dump -U alfresco -w -F t -b alfresco > /tmp/postgres.dump.tar   // backup postgresql DB
5. ./ stop postgresql               // stop postgresql
6. tar -cvf /tmp/alf_data-contentstore.tar alf_data/contentstore                              // backup content store
7. tar -cvf /tmp/alf_data-contentstore.deleted.tar alf_data/contentstore.deleted      // backup content store deleted items
8. cp /tmp               // save copy of
9. cp bin/ /tmp                           // save copy of
10. cp /tmp                                    // save copy of
11. ./ start

Alfresco restore
1. Install Alfresco
2. cd /opt/alfresco-community
3. ./ stop                           // stop Alfresco
4. ./ start postgresql         // start postgresql
5. su - postgres
      DROP DATABASE alfresco;
      CREATE DATABASE alfresco WITH OWNER alfresco;
      ctrl-d (exit)
6. /opt/alfresco-community/postgresql/bin/psql -U alfresco -d alfresco
      ALTER USER alfresco WITH PASSWORD 'alfresco';
      ctrl-d (exit)
7. /opt/alfresco-community/postgresql/bin/pg_restore -w /tmp/postgres.dump.tar
8. exit    // from postgres ID
9. cd /opt/alfresco-community
10. ./ stop postgresql         // stop postgresql
11.   tar -xvf /tmp/alf_data-contentstore.tar
12. tar -xvf /tmp/alf_data-contentstore.deleted.tar
13. rm -f /opt/alfresco-community/alf_data/solr4/index/workspace/SpacesStore/index/*
14. rm -f /opt/alfresco-community/alf_data/solr4/index/archive/SpacesStore/index/*
15. rm -f /opt/alfresco-community/alf_data/solr4/model/*.xml
16. rm -Rf /opt/alfresco-community/alf_data/solr4/content/_DEFAULT_
17. cp /tmp/ /opt/alfresco-community/tomcat/shared/classes
18. cp /tmp/ /opt/alfresco-community/bin
19. cp /tmp/ /opt/alfresco-community
20. ./ start