Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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
share|improve this answer

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.

share|improve this answer
    
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

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.