Upgrading your magento site without downtime

Posted by: Karen Tuesday, August 24th, 2010

Before you put on a load of changes to a live site it’s advised to test. Obviously we hope you’ve tested locally, etc, but what if you have an external theme that’s been updated, and how do you test in as close to live as possible?  Here is your answer:

  1. Backup your live database – see here for more info
  2. Backup your Magento site completely
  3. Create a new directory under your magento install called test
  4. Copy the Magento site files into this test directory, maintaining permissions (e.g. tar xvfp)
  5. Make a new database with a new name on your site
  6. Import the live database backup – you may want to disable foreign key checks when doing import
  7. Modify the core_config_table base_urls to point to your test location, e.g. http://www.mysite.com/test/
  8. Modify app/etc/local.xml to use the new database
  9. Run up frontend/backend and make sure is working

You now have a fully working test site.  You can then make your changes on this without affecting the live site.

Once you are happy everything is working you can then either redirect people to use this new location, or do what I do and move your old site to a different subdirectory, and put your new site in the httpdocs folder.

The big advantage of this approach is that if you find an issue a couple of days down the line you can easily just move back to the old server – it’s still there in the background.  I’d advise you switch off checkout so people can’t use the old version.

Comments are closed.