themhz
themhz

Reputation: 8424

How to synchronize localhost version changes with production version

I have been doing some changes these days on a localhost version of a joomla 2.5 website. Those changes consist of creating new files or editing previous ones, adding tables in the database and changing others.

But all these days a friend of mine was creating articles online causing changes to the database and the file system. Now I am in position of thinking, how to synchronize the online database + files with the localhost version of them. Is there a tool? or I need to eyeball the changes done in the database and the file structure of the joomla application and sync them by hand? What is the common practice for this issue?

thank you

Upvotes: 3

Views: 1759

Answers (1)

Riccardo Zorn
Riccardo Zorn

Reputation: 5615

You have two issues here: database and files sync.

The first thing you should do is set up a code versioning system, be it svn or git doesn't really matter, as long as you keep your data safe. Dump both dbs to the svn too just in case.

If you didn't touch the database, then you can just update the files. Please note that extension installation will also make changes to the database.

If you created minor changes to the database, you'd better recreate them manually.

If you have created major changes, you'll be better off inserting the content, assets, categories tables from your live site into your dev site database, add any images that were added along with the articles. You can selectively output database dumps excluding specified tables, i.e.

mysqldump -u username -p database --ignore-table=database.jos_session 
    --ignore-table=database.jos_content  --ignore-table=database.jos_menu 
    > database_config.sql

!This is just the syntax, you will need to determine the table names by yourself!!!

You can achieve the same with phpmyadmin or the like.

Now to code. If no files (other than images) were created on the production site, you can safely move your development files over to the server.

Otherwise put your development site under code versioning, commit or push, then copy the production files over them and use the svn / git features to examine code differences and to publish to the live server once everything is ok.

If you can read Italian I have published an article that sums up a few of these concepts in a nicer format: http://www.fasterjoomla.com/it/soluzioni-joomla/svn-per-joomla

Upvotes: 2

Related Questions