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?

Thenks



Alfresco backup
1. cd /opt/alfresco-community
2. ./alfresco.sh stop                                 // stop Alfresco
3. ./alfresco.sh 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. ./alfresco.sh 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 alfresco-global.properties /tmp               // save copy of alfresco-global.properties
9. cp bin/apply_amps.sh /tmp                           // save copy of apply_amps.sh
10. cp alfresco.sh /tmp                                    // save copy of alfresco.sh
11. ./alfresco.sh start


Alfresco restore
1. Install Alfresco
2. cd /opt/alfresco-community
3. ./alfresco.sh stop                           // stop Alfresco
4. ./alfresco.sh start postgresql         // start postgresql
5. su - postgres
      /opt/alfresco-community/postgresql/bin/psql
      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. ./alfresco.sh 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/alfresco-global.properties /opt/alfresco-community/tomcat/shared/classes
18. cp /tmp/apply_amps.sh /opt/alfresco-community/bin
19. cp /tmp/alfresco.sh /opt/alfresco-community
20. ./alfresco.sh start

Outcomes