Burts AIS, osCommerce & More Blog
New URL: www.osworld.biz

Friday, March 24, 2006

The Stress Free way to move an osCommerce site

The other day, Rich posted about the stress of a server move. It can be a nightmare to move a site, particularly a dynamic, interactive sites usch as an osCommerce Shop. Here's how I move osCommerce sites: 1. Purchase a cheap temporary domain name (eg: www.yoursite.info) 2. Select your NEW host, and get the account set up (using the NEW domain name). 3. *Copy* all files across from the OLD host to the NEW host. 4. Set up the NEW configure.php files using the NEW domain name. 5. Set up the OLD host so that the MySQL Daemon can be accessed from the new host. Using cPanel (uugh) this is very simple, if you don't have cPanel, then the host can easily do this for you. 6. Go back to the NEW configure.php file and set up the DB connections at the bottom of this file to access the OLD hosts database connection. Now, think about this. You have two sites, each of which is exactly the same as the other. Except for domain names. Most importantly, both OLD & NEW sites are pulling from the one database. You can now take your time to make sure everything works on the NEW host by using the NEW domain. Once happy: 7. Make your DNS changes on your ORIGINAL domain name, to match the NS details the NEW host gives you. 8. At the same time, PARK your OLD domain on top of the NEW one. 9. And change the Domain Details in the NEW configure.php to match your OLD domain name. We know that dns changes take between 1 hour and 48 hours or so to update - this means that ISPs around the world will see the NEW hosting at different times. Because you still have the NEW hosting using the OLD hosting MySQL, you are still running 1 database, thus you will lose no orders during the changeover. Once you are sure that the DNS changes are complete: 10. Close down BOTH OLD and NEW sites for 20 minutes (say on your quietest time in the middle of the night). During these 20 minutes; 11. Take a dump of the OLD database 12. Set up MySQL on the NEW hosting. 13. Transfer the DB to the NEW. 14. Change your configure files to stop accessing the OLD host DB and make sure that they are accessing their own DB (on the NEW). It sounds complicated, but is in fact really very simple. Doing a server swap this way, ensures that you lose the minimum of orders, as you will be down for only about 20 minutes maximum. If you work quickly, it is possible to have downtime of less than a couple of minutes! Sure, you'll have spent a couple of pounds for a throwawy domain name (you could go on to use this for something else, perhaps a feeder site for your main domain, or a different site entirely). If you buy the cheapest possible, a .info for 1 year, you'll be paying less than $3 (£1.50) or so. This is beer money compared to loss of orders, surely?

Serious Advice for all osCommerce Store Owners Don't rely on a host to understand the best way that a 3rd party script works => go to someone who you feel can do the job quickly and without fuss! It might cost a little more in terms of money, but will cost a lot less in terms of stress, hair loss, and keyboard pounding.

New URL: www.osworld.biz - thanks!

6 Comments:

At 3/24/2006 09:01:00 AM, Anonymous Jared said...

This also assumes that your host allows remote MySQL connections. Some do, some don't.

Good guide, Gary!

 
At 3/24/2006 09:09:00 AM, Blogger Gary B. said...

J, I've never known a host that doesn't, and I've done this at least 50 times for myself and clients.

All cPanel hosts do allow it, and any host who isn't running cPanel should know enough to be able to set it up...if they don't know how to do it, then you should be moving host, post-haste!

In any event, if the OLD host doesn't/can't/won't allow it, make sure that the NEW host does. Then close down the OLD for 5 minutes, set up a MySQL on the NEW and dump the OLD db onto the NEW. Update the Configure on the OLD to reflect the NEW db host details.

Now you have the OLD site pulling from the NEW location. That would work just as well.

I might put this onto a PDF along with diagrams sometime - it'll be a good help for people moving sites.

Cheers.

 
At 3/24/2006 01:13:00 PM, Anonymous Anonymous said...

Some hosts block the default MySQL port with a firewall, however :(

 
At 3/24/2006 03:34:00 PM, Anonymous Wayne said...

Great Blog! Enjoying reading it...

The reason why most hosts are being to block this is that you'll fail security scans from companies such as Verisign when being audited for credit card processing agreements / standards. I'm in the hosting business - believe me, we see this all the time. Clients who's hosts fail the security audits don't get accepted for online card processing.

It's primarily an issue when the MySQL service is running on the same server as that of the Apache / IIS services hosting the site, but other factors also come into play (e.g. what versions of MySQL are being used).

Visa / Mastercard and the like are starting to take internet fraud in a serious way and hosting companies are taking a lot of heat (as they should) for their security practices . Blocking MySQL and SQL port access to the "public" and only opening it up to VPN clients is quickly becoming the norm. If you haven't run into it already you will, probably sooner than later.

 
At 3/24/2006 05:49:00 PM, Blogger richandzhaoyan said...

Great post Gary, pity it is a little late for me this time around ;)- The stress, hair loss and keyboard pounding have already occured.

Seriously, it was my first server move and had the hosts not offered to move the site for me, I would have done a lot more research and testing prior to the actual switchover. In the event, I think I just got very unlucky with the way the database corrupted when moved.

Still, you live and learn and next time I will be all the wiser for your input.

Also, thanks Wayne for the explanation about the mySql blocking.

 
At 3/24/2006 07:37:00 PM, Anonymous boo said...

Thanks for this Gary. Luckily I haven't had to tackle a server move involving live stores before, but I'll bookmark this for when the time comes.

 

Post a Comment

<< Home

View Latest Posts

To View Newer Posts - Click Here!