Sync Prod to Test Alfresco instance

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

Sync Prod to Test Alfresco instance

Hi,

I'm a complete Alfresco noob.

We have two Alfresco instances - one Prod and one Test running 5.2.0.
I've been told that the Test Alfresco does not have the same stuff as the Prod Alfresco.
I don't know anything about Alfresco but is there an easy procedure for synching them up - we need the latest data from Production Alfresco to the Test Alfresco?

I guess I will need to stop the alfresco service on both sides and dump out the database somehow and the content store from Prod to Test. And then restart the Prod and Test services? Is there any docs or how-twos on doing something like this?

This is what I've figured out about the Environment on Prod Alfresco so far:

Storage:
/opt/alfresco/alf_data/contentstore + ../alf_data/contentstore.deleted
/opt/alfresco/alf_data/solr6
postgressql - where is this???


Configuration:
Alfresco: /opt/alfresco/tomcat/shared/classes/alfresco-global.properties
Share: /opt/alfresco/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml
SOLR:
/opt/alfresco/solr6/solrhome/conf/shared.properties
/opt/alfresco/alf_data/solr6/solrhome/alfresco/conf/solrcore.properties

3 Replies
abhinavmishra14
Advanced

Re: Sync Prod to Test Alfresco instance

You can use backup and restore option to take latest backup from your prod env and restore in new env. 

Note: Make sure the new environment is having enough memory and configurations to run the prod equivalent load (if you also perform load testing in this env.)

Since you have a prod env running, you need to do hot backup. Steps(high level steps) should exactly in the order as given below:

Step1- Take solr index backup, based on your inputs it is :

 

/opt/alfresco/alf_data/solr6

 

Step2- Take backup of any solr specific configurations such as shared.properties, solrcore.properties, solr.in.sh (if there are any custom changes in this file) etc. Based on your inputs :

 

/opt/alfresco/solr6/solrhome/conf/shared.properties
/opt/alfresco/alf_data/solr6/solrhome/alfresco/conf/solrcore.properties

Do check any additional files that you have modified/customized for solr for example any changes to "/solrhome/archive/conf/solrcore.properties" or "/solrhome/templates/rerank/conf/solrcore.properties" or "solr.in.sh"

--------------------------------------------------------------------------------------------------------------------------

Step3: Take "alfresco" database backup  (after you have backedup solr). 

Check the following property in your alfresco-global.properties to obtain the connection url.

Example:

db.url=jdbc:postgresql://localhost:5432/${db.name}

 

Based on above details, connect the postgresql server and take a db dump that will be used for restoring into new environment. If you need help connecting to postgresql and how to take backups, checkout the documentation/tutorials

Some examples

https://www.postgresqltutorial.com/connect-to-postgresql-database/

https://www.postgresql.org/docs/8.1/backup.html

https://www.postgresqltutorial.com/postgresql-backup-database/

--------------------------------------------------------------------------------------------------------------------------

Step4: Take the contentstore backup once all the above steps are done. You can use "rsync"

Based on your inputs: 

 

/opt/alfresco/alf_data/contentstore

"/alf_data/contentstore.deleted" is optional.

 

--------------------------------------------------------------------------------------------------------------------------

Step5: Finally, take backups for any configurations related to repo and share such as "alfresco-global.properties", "share-config-custom.xml" etc. after completing all the above steps. Make sure you take backup of all cutomizations done under "/tomcat/shared/classes/alfresco/extension" and /tomcat/shared/classes/alfresco/web-extension" if you have any.

--------------------------------------------------------------------------------------------------------------------------

Step6: Stop the environment where you will be restoring if it is running currently

Step7: Copy the existing contentstore (dir.root) to a temporary location and Restore contentstore (dir.root) to the new environment. 

Step8: Restore db from 'alfresco' database backup. Consult your DBA if needed.

Step9: Apply configurations that are backedup for repository and share.

Step10: Restore solr

Step11: Apply configurations that are backedup for solr

Step12: Restart, test/debug if there are any errors. 

Also must refer documentation (it refers to solr4, you can ignore those steps): https://docs.alfresco.com/content-services/5.2/admin/backup-restore/#performing-a-hot-backup

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
th15
Member II

Re: Sync Prod to Test Alfresco instance

Thanks. Forget to mention that we are running Alfresco Commmunity Edition, so does any of that matter for the above steps?

Also, our Solr indexes for both Prod and Test are on different instances.

abhinavmishra14
Advanced

Re: Sync Prod to Test Alfresco instance

No, it should not matter in general. 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)