Joomla Dev/Prod Synchronisation

Written by 

In production environments it is usual to setup a development environment and a production environment. Any changes are then tested on the Development environment first and then these changes are synchronised with the production environment.

Joomla does not provide a synchronisation mechanism but some of the site backup tools such as Akeeba allow you do a backup and then a restore. This works fine but is a pain as it can take ages for a full backup to be copied across the wire.

So, the solution I have come up is basically:

- Setup a dev environment on my local machines at home

- Do all my changes and test locally

- Do a database dump (or dump affected tables)

- Do a database restore on the production website

- ftp any changed files from the dev website to the production website - as Joomla stores articles, menus etc in the database you only need to do this for any CSS or PHP files that you modify plus my Photogallery. 

- I manually perform any Joomla and package updates on both dev and prod.

Naturally, I expect that at some stage due to the manaul processes involved that the two may get out of sync.

 

I setup a local dev environment on my MAC using Joomstack as I was too lazy to do anything else.

Synching K2 articles and associated photos

Most of my articles use embedded photographs, so also need to sync JoomGallery.

Step 1 - backup in case you stuff up:

First do database dump of everything on both sites - just in case you stuff up and need to restore.

Step 2 - backup your articles and photos from prod

Using phpMyAdmin export  the following tables from the prod site - this is too maintain article hits:

dbname_joomgallery_*

dbname_k2_*

dbname_assets

dbname_finder_*

Make sure the "Add DROP TABLE statement" is selected. if you miss this step you will end up having a heap of duplicate entries.

Step 3 - import the tables from Step 2 to the dev site

Use phpMyAdmin to import the database backup above

Step 4 - Make your changes

Update your Articles and Photos on the dev site

Step 5 - backup your articles and photos from dev

This is the same as Step 2 except on the deve site

Step 6 - import the tables from Step 5 to the prod site

Same as Step 3

Step 7 - Synch the photos

Using Filezilla synchronise the gallery folder

 

Future enhancements:

- Use Rsync to do the gallery sync

- Only import new rows from the dev database to prod.

select j.*
from joomla.whu3_k2_items j
left join joomla3whungee.whu3_k2_items j3
on j.id=j3.id
where j3.id IS NUll

 

Read 2544 times Last modified on Thursday, 13 February 2014 16:09
More in this category: « About Adrian

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.