Version 7.1

Using a CDN to help migrate your sites hosting

by Simon Cox



Using a CDN to help migrate your sites hosting

Moving a site to new hosting can be fraught with issues. Here is one technique that I find useful when moving to a website to a new hosting server.

without having that DNS propagation wait

As part of an upgrade to a site we want­ed to add a blog to pro­vide news and updates. The site was flat filed so putting it onto Perch was the obvi­ous way to go — there were plen­ty of oth­er ben­e­fits as well. I want­ed to make the tran­si­tion from the sites US host­ing, where it had been for some years, to WESH — a UK based host. I had devel­oped the site local­ly and was ready to upload it to the new host­ing but I want­ed to avoid the DNS prop­a­ga­tion dance which always annoys me.

This site was already set up on the cloud​flare​.com, a Con­tent Deliv­ery Net­work. The domain name then resolves to Cloudflare’s plat­form and caches your site allow­ing for faster delivery. 

The new site was then uploaded (old school FTP) and the mysql file installed on the new host using the IP address.

I checked through the site using a chrome plug in — Vir­tu­al Hosts — that allows you to do a local DNS change. I mapped the sites domain to the new IP address and then could test using the domain name. It has a lit­tle red light to remind you that it is on — don’t for­get to turn off later!

I then logged into Cloud­flare and changed the type A set­tings for the domain to the new IP address. On this site I only have the web­site going through Cloudflare’s ser­vices. FTP, Mail and oth­er stuff is DNS only and avoids the CDN services.

The deliv­ery of the new pages is instant as there is no DNS prop­a­ga­tion need­ed as we have not changed name servers. But there is one more step to smooth things along. I go to Caching in Cloud­flare and use the Purge cache process. The Purge Indi­vid­ual Files’ but­ton is a drop down and you can choose Purge Every­thing. The refresh­es the CDN with the files from the uploaded site. This step isn’t nec­es­sary if you have moved every­thing over from the old host. In this case I had rebuilt the site onto Perch so it was a new site and I need­ed to purge the cache. You could leave the cache prim­ing to the first vis­i­tors but I like to give a quick vis­it to the main pages. This trig­gers Cloudflare’s caching so fol­low­ing vis­i­tors can enjoy the fast pages.

I did not change the IP address for the mail ser­vices as I will need to talk the client through that. At the moment mail ser­vices are still man­aged through the old servers. Updat­ing email set­tings is usu­al­ly the most time con­sum­ing part of the whole process. In this case I can send a file so it recon­fig­ures her email set­tings auto­mat­i­cal­ly. Once done I leave it a few weeks then close the host­ing ser­vice down. 

And that is it. While oth­ers are refresh­ing wait­ing for the DNS to prop­a­gate I am off for a cuppa.


Other articles in this topic

Using Google Data Studio to review your http to https migration

Migration from http to https can be fraught with issues you need to track and check. I looked for a way to help track migrations and give me additional insights using Google Data Studio. Read more about Using Google Data Studio to review your http to https migration

A first look at Safecont content quality analysis SEO tool

Review of a new tool from Data elasticity S.L in Spain that analyses the quality of your websites content Read more about A first look at Safecont content quality analysis SEO tool

How to find insecure pages in your site before Google start penalising them

Google will be highlighting all non-secure sites from July 2018 meaning that the Insecure Content Report of Screaming Frog will be in use a lot over the next few months - I will show you what to do. Read more about How to find insecure pages in your site before Google start penalising them

How I add canonicals into Perch CMS sites

The Canonical link in a page's header lets the search engines know where the original page resides. Originally conceived for situations where articles were duplicated they would reference the original. Google tends to choose the oldest version of a page that it can find (but not the only method it uses) and any other pages with the same or very similar content are considered duplicates and will not do a well on the Search Engine Results Pages - SERPs and we want our pages to do well there for the traffic. Read more about How I add canonicals into Perch CMS sites

EU cookie consent law largely ignored

The EU has give the UK until May 28th 2012 to comply with the cookie consent law - how many of the organisations pinpointed by the ICO have met the deadline? Read more about EU cookie consent law largely ignored

HTML Test Page for CSS Style Guide

This content is used to test that css has been covered for all tags used in content. Read more about HTML Test Page for CSS Style Guide

EEUK11 report

The UK's first ExpressionEngine conference has taken place in Manchester in August 2011. I provide a report on the event itself and the surrounding activities. Read more about EEUK11 report

Assets for ExpressionEngine

Assets is a new file management add-on for ExpressionEngine and brings a new way of managing assets in your website. I installed it and built a simple image Gallery. Read more about Assets for ExpressionEngine

Responsive web design

Responsive web design has been emerging as a way forward over the past two years. Following inspiration from the way Simon Collison's crafted his personal website I have now implemented a Responsive Web Design on this, my personal website. Read more about Responsive web design


With HTML5 finally emerging from the primordial soup I thought it was time to have a look at where we have got to with fonts on the web, what today's techniques are and what is new in the world of the digital hot metal. Read more about WebFonts


Online testing suites are a very useful way of checking your website to see if it's up to scratch. I take you through Nibbler from Silktide. Read more about Nibbler

New look for 2010

I have finally taken the plunge and updated the site and have switched over to ExpressionEngine. Read more about New look for 2010