Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hello i am working on a large php/mysql project and i am getting to the point where everything get really confusing.

I have a dedicated sever that runs CentOS with PLESK. And i have a windows PC with XAMPP.

Now the way i work is doing the development and basic testing om my PC, and whenever i feel the need of testing something on the server i upload everything and and test it on the server. Especially for the mysql changes this is really a pain, I have to export and import a new database again and again.

Is there some kind of method of easily switching between these envoirments. Or can someone point me in the right direction, because i have never made applications of such a large scale.

Thank you for your time.


locked by HopelessN00b Jan 21 '15 at 9:09

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

closed as off-topic by HopelessN00b Jan 21 '15 at 9:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 2 down vote accepted

Basically, the 3-server-setup is the right way to go, depending on how many people are developing even a 4-server-setup:

  1. local environment for coding, testing changes, etc.
  2. (optional) a development server for all developers which always gets the latest sourcecode from the repository
  3. a staging server which should have the same configuration as 4 and on which new releases are being tested first
  4. the actual production server, which should only be updated with code which has been thoroughly tested on the staging server If you use some kind of SCM system, the deployment of the new database should be easy by just writing a script which dumps the the latest version of the database content, puts it into the SCM and updates the server 2 and maybe 3 automatically.

So, the keywords are:

  • use a source code management system
  • automate as much of the build and deployment process as possible

First up, this really isn't a system administration issue at all but I doubt the other trilogy sites are any more suitable than this one.

The way you're doing it makes a lot of sense but you can make life of whole lot easier for yourself with some automation. Why not create scripts to do all that updating? One part of the script does the dump, upload and import of MySQL, while another part can use any number of tools to upload only what's changed in your PHP.

Do you have any guides in creating such scripts? – Saif Bechan Apr 22 '10 at 13:23
I don't have any guides, although I'm sure they're out there somewhere. The principle is easy enough though. Use mysqldump to export the data from one server, use whatever means you have available to transfer the dump file(s) (e.g. wget/wput, rsync, ftp, etc.) and finally use the mysql client to import it all on the target system. – John Gardeniers Apr 22 '10 at 21:29

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