More Tips for Making a Web Hosting SwitchBy
In November 2006 I wrote a post called 6 Easy Step to Making a Web Hosting Switch. The steps I spelled out were the basics – for moving a basic site. This past weekend the post made a resurgence when it was featured by Wendy Boswell at Lifehacker.com (Easily Switch from One Web Host to Another). I was really impressed with the quality of comments and the willingness of my new visitors to share more knowledge with my readers. There is just too much good information to leave it all in the comments. Here are more tips for making a web hosting switch.
When your website uses any kind of insert data in a database (register users, add comments or anything else) itâ€™s better to create a holder page while moving and testing everything on the new host, avoiding forgotten data on your DB. I always do that putting a holder on the old host and, on the new, keep everything working fine, because when changing DNS servers it may take a while replicating the changes to the â€œworldâ€.
From Steven Rushing:
Something that very new website owners may not think about is your databases. My very first host switch, I downloaded all my files and ran. I reallly didnâ€™t like my host.Â But without the database my wordpress files were useless! This was 4 years ago now, when I was very new, but DONâ€™T FORGET YOUR DATABASES!
Problems arise when people buy domains from the same web host, because transferring domains is much, much more complex (if even possible) so I would also recommend that you never buy your domain from the same company that hosts your site, even though it seems more convenient.
If you have access to your machineâ€™s hosts file, do this before changing the DNS servers with your registrar:
Add entries domain name pointing to your new hosting companies IP in your hosts file (Linux, /etc/hosts; Windows, should be %SystemRoot%\System32\Drivers\etc\hosts). Then, when you go to your site in your web browser, youâ€™ll be seeing it from your new site. You may have to restart your browser or even your computer (or just manually clear the DNS cache).
For example, if the new IP address is 184.108.40.206 and your domain is yourdomain.com, add this to your hosts file:
220.127.116.11 yourdomain.com www.yourdomain.com
This way you can test before every committing to changing DNS servers. If all looks good THEN change your DNS over.
Check out a Slicehost VPS. Switched from multiple shared hosting providers to a VPS and the performance has been orders of magnitude better that a shared host. Itâ€™s for the technically inclined, but if you get a VPS or dedicated server, itâ€™s trivial to move between hosts.
Your list is not perfect. When you sign up for new hosting, you can have the new hosting company provide you with your IP address so you can actually see your files on the web before you change the name servers. You will also need to update your scripts as the name of your database may change depending on some hosts.
Also, some hosts (such as for .nr domains) are very picky about name server changes.. it can really be hard when some lousy companies donâ€™t even have an online control panel for you to manage this stuff.
I would not recommend having your hosting provider register your domain for you in order not to have problems later when moving to a new host.
I agree with a couple earlier postsâ€“for database driven sites, the database is the most important part. Hereâ€™s a good tip if you know how to configure your databases.
First copy the files to the new host, and then also copy the database to the new host.
Then change the permissions on the new hostâ€™s database so that the OLD host has permission to access the database, and then go to the old site and edit the config files to point to the database on the new host instead of localhost.
Now if you edit the DB content (posts, comments, etc.) the changes will all be on the new host, and the database on the old host isnâ€™t needed anymore.
Then whan that all works, switch the DNS to point to the new hostâ€¦.and editing your local hosts file to test the new host first is a good idea.
easier way – if your host is cPanel; just tell your new host to do the transfer for you – they can do it immediately within a couple moments ; all your files + emails and settings will be instantly transfered.
One of the reason I prefer CPanel control panel over other control panel is because switching between Cpanel host is much easier. WHM has a feature that can helps in downloading the entire site from one server to another and thus making moving host very easy (HostGator is using Cpanel).
From Gil Megadish:
Iâ€™m an expert at this field
I have moved 5 providers in the past 2 years. The guideline above is good for static websites. I have encountered difficulties not discussed in the post. Among are:
1. While DNS update is propagating, some users see the old server, to which they register and add new content. While others see the new server and add new content to that. Within 48 hours, nobody will be using the old server, but how do you sync the old with the new?
2. Apache/PHP versions matter! PHP of one version returns warning which is an error on the other. Different versions of shutils behave differently. And last but not least, sendmail never survives the move! Remember this!
3. Always make sure your new server can handle at least the same load as the old server. If possible, make an .htaccess to force 301 redirect to the new server (by ip address of course.)
4. Use Amazon S3 for user uploaded media!
5. Another trick I havenâ€™t tried yet, is to set two A record on your DNS, with priority for the old server. Then let it propagate for 48 hours before simply shutting down the old server and removing it from DNS. That way, clients are supposed to try both IPs, so for the first 48 hours, they will always fail on the first IP before moving to the second. Havenâ€™t tried it yet, but time will come to move again
I had a similar post some time ago.. This one is specific for wordpress blogs. If anyone is interested, it is at: http://blog.gadodia.net/steps-to-move-your-blog/
From Baz L:
These steps work great if you have just HTML content. Things get a bit more complicated when you have MySQL databases involved. This will help: http://www.webdevelopment2.com/moving-wordpress-to-a-different-domain/
Have you done a hosting switch? If so, what would you do differently next time or what did you learn in the process?