Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

We are using Ubuntu 12.04 in our Production environment. This server hosts Apache, MYSQL and PHP for our corporate websites. We have 7 websites currently deployed using virtual hosts.

Looking for a solution on how to replicate or push changes onto our production machine by using a development machine.

Our main goal is to let web developers make their changes on our "development" server and then we can push the changes onto our "production" environment. Basically the /var/www/* files and MYSQL databases.

I already have a clone of our production environment setup in our development environment.

Any suggestions or help would be greatly appreciated.

share|improve this question

1 Answer 1

Since I did not receive any feedback, here are the steps we took:

1) We duplicated our production linux webserver using vRanger. If you do not have Vranger license, you can probably get away with using vMware workstation and duplicate the vmdk file. (I have not tested this process)

2) Powered on the copy of our production gave it a different IP address.

3) Since both our Production server and our Staging server are identical I used RSYNC to manually sync since changes when necessary. Here is a sample of the command:

sudo rsync –avh /var/www/sites/ root@192.168.1.1:/var/www/sites/

Here is an explanation of the command above:

**sudo** = temporary gain privilege to execute the command
**rsync** = utility to synchronize data between two different server/folders
**-avh** = commands for rsync – a = archive – v = verbose – h = human readable format of file sizes
-**/var/www/sites** = source (our staging server - server we are pushing changes from)
**-root@192.168.1.1:/var/www/sites** = destination of where the files are being copied to (production server)

4) We purchased a tool called SQLyog there are different pricing modules and features depending on what you need it for. https://www.webyog.com/

There are freeware tools too for example Toad for MySQL 6.7 Freeware (had a hard time using it)http://www.toadworld.com/products/toad-for-mysql/default.aspx

What both of these tools accomplish is if you are running multiple MYSQL databases like us, we can view the MySQL changes made in our staging environment and push the changes to our production environment.

You can push changes using MYSQL using the command line as an option too (using mysql dump). I find it much more convenient to use the SQLyog utility.

That's all there is to it. Just remember to make a backup of your files and test the procedures before using it in your production/live environment.

I take no responsibility if you break something, or don't know what you are doing.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.