There are various ways to replicate Joomla! environments we can use 3rd party tools like XCloner, etc… In this article, I am going to show rather simple way to achieve the replication of Joomla! or any other CMS.
Background: We are replicating server1 to server2
Assumptions: Both servers have Joomla! installed up and running
Step 1 (Server2): Rename configuration.php to configuration.server2
Step 2 (Server1): Backup file system to a *.tar file. We will name it backup_server1_ddmmyyyy.tar
Step 3 (Server1): Backup database of Server1. We will name it db1
Note: You can achieve step 2, and step 3. Using following bash script
Step 4 (Server2): Drop all tables in db2
Note: You can use following sample script for Step 4
Step 5 (Server2): Extract backup_server1_ddmmyyyy.tar (overwrite mode!)
Step 6 (Server2): Restore db1 using db2 connection string
Note: You can use following script for Step 5 and Step 6
Step 7 (Server2): Delete configuration.php
Step 8 (Server2): Rename configuration.server2 to configuration.php
This is one way to replicate or sync to Joomla! websites. There can be many solutions if you know a better tool or way please share.