Skip to main content
Participant
September 9, 2009
Question

PHP/MySQL Test/Production Server best practices

  • September 9, 2009
  • 1 reply
  • 1361 views

Hello,

     I am currently learning PHP/MySql and have setup a test server to develop on and a production server to go live with. I wanted to know what are the best practices for synchronizing the test server with the production. Should I export the database from the test server and import it to the production server each time I make a change or is there better way to incrementally sync the databases. I am using Dreamweaver to design the web site.

Thanks,

Nick

This topic has been closed for replies.

1 reply

David_Powers
Inspiring
September 9, 2009

Develop the site locally, including an administrative back end. When it's ready, upload it to your remote server. Once the site is live, use the remote version of the administrative back end to administer the database content. Schedule regular backups to download the database content for safe storage locally.

nik0m0nAuthor
Participant
September 9, 2009

Thanks, but does this mean that after I go live I should make changes on the production database only and not use the development database, if say I need to add a new table or record(s)?

Procedure

1. Take production web site down

2. Export/Save current database

3. Make changes to production database

4. Export/Save new database

5. Bring production web site up

Is this correct?

David_Powers
Inspiring
September 9, 2009

How you do it depends on you. If you're planning to change the structure of a database after it has gone live, you could be creating problems for yourself. The point of a development environment is it's where you test everything, and once it's ready to go, you deploy it on the live server. If you need to add new tables later, you're going to start corrupting your data during the testing process. In such circumstances, it might be better to create a new database, and import the live data when it's ready for deployment.