Local to Live (Again)

Permalink
I've seen many posts on this but most are dated from 2009.

These are the pre-reqs:
- I already have a live server where I edit everything directly on it and change permissions based on when they should go live to the public.
- I just recently started developing on a local server.
(Yes, I know I should have done this in the reverse order)

My questions now are:
- How do I take everything that's currently live on my web host and replicate exactly the same way with the same settings into my local host?
- How do I make it seamless between making changes on this local host to reflect it on the live server?

Appreciate the help in advance!
Keith

MavenMedia
 
programmieraffe replied on at Permalink Best Answer Reply
programmieraffe
Hey Keith!

I made a deployment-prototype-setup in the last weeks with the help of jenkins (http://jenkins-ci.org/) and versioning via mercurial (hosted on github).

Basically I do the following steps when i do deploy stuff:

"LOCAL/DEV" => LIVE
- rsync/copy all files from the dev to the live server EXCLUDING the files/, packages/ and a config file (which is included in site.php and contains the database settings, because they are diffrent)

LIVE -> "LOCAL/DEV"
- simply copy the files/ and packages/ directory from the server to your dev environment and dump your local database and replace it with the database from the production server

Important: Changes you want to do in the dashboard can only be done on the production instance, because migrating the database from local to dev is really complicated and i wouldn't recommend it. This deployment strategy is only used for altering the files (like theme files and stuff), not something in the dasbhoard.

Additionally I have my files in a mercurial repository on github, so that multiple developers can add code changes. The Jenkins server then pulls the latest version from the repository and rsync's it to the live server (you could create here a staging/dev instance as well). (files/ and packages/ directory is ignored in my directory, because this could seriously "destroy" things on your production server, e.g. delete files which were uploaded and packages installed)

Cheers, Matthias
MavenMedia replied on at Permalink Reply
MavenMedia
Ok I'll try this when I get a chance later and get back to you.

Thanks for the quick reply Mathias!