I’m developing an online store with Magento. The site will be high traffic and will need a two server setup, Testing and Production.
My question is how do online stores, specifically Magento handle this?
The idea I had is:
- Take Production site offline
- Empty Testing database
- Copy data from Production database. (Maybe )
- Test
- Copy files and database to Production site
I know Magento offers a Enterprise option, but this is a script I would like to write myself.
You should not need to take the production site offline.
What I would sugest (and you should be able to script this) is on the production site to run
mysqldump -u root -ppassword db_name > db_name.sqlto produce a copy of the database. then run rsync (you can get it for both linux and windows) on the files directory to rsync to the test machine any files you want to copy (images?)After you do any testing on your that you wish to push to production you can do it one of 2 ways. either (and I prefer this method) save any changes you made to the database in a sql file and run that on the production site and at the same time sync back any changed files. or you can use mysql to log all queries to a file, then re-play these on the production site.
Best not to take the production site down if you dont need to.