Moving EP Studios

New EP Studios Headquarters
New EP Studios Headquarters

EP Studios is preparing to move to its shiny new headquarters in Parker, Colorado (formerly EP Studios Western Division).  The former HQ in Lousiville, Kentucky will be shutting down as of January, 2014.  Besides the physical move, it has been necessary, due to the rotten bandwidth of the DSL Internet service at the new location (somewhere between a 56K dial-up modem and 1.5 Mbps), to move this site, epstudiossoftware.com, from TomServo, the trusty web server located on the floor of my guest bedroom, to an online hosting service.  I have known that this would be necessary for quite some time, but I hesitated to start the process, fearing complexity and a wasted weekend.  Alas!  My fears came to nought!  It actually was pretty easy.

I selected DreamHost as the hosting service, mostly because my friend John Mandrola uses it to host his site, Dr. JohnM.  EP Studios is a WordPress blog.  I emailed the folks at DreamHost and told them that I was interested in moving my website and web email to their hosting service.  They wrote me back promptly, including this link that describes how to move a WordPress site to DreamHost.  The cost was a reasonable $9 per month.  I took the plunge and signed up.

My Internet sites are registered with eNom, a registration and hosting company which I have used from the start.  Although DreamHost provides domain registration I saw no reason to change registration, especially as I have paid for a few years in advance.  So what I was looking at was moving my site to a new host, but not changing the domain registration.  This link from DreamHost outlines the various combinations of changing registration and hosting, and was quite useful for understanding the steps I had to take.

DreamHost provides ftp (file transport protocol) access to your new site even though you can’t directly access it using the http procotol (the usual way to access a site with a browser).  With the user account and passwords set up, ftp is used to move files up to the new site.  So how do you move your whole website?  There is a tool to do this, the Duplicator plugin for WordPress, which just works!  It zips up your website, including the MySql database into one zip file.  I then ftp’d the zip file as well as the installer.php program that comes with the plugin up to my new site directory.  Prior to running the installer script, I set up a MySql database at the new site (also very easy to do).  I then ran the installer.php script, not believing for a moment that it would work.  But it seemed to unzip everything just fine, and the files seemed to be in the right place.  The installer.php script moves the WordPress database (which contains your posts, among other things) to the newly created MySql database.  Browsing the tables in the database, everything looked fine.

In transferring a site, there is a bit of a chicken-or-egg problem.  You want to test your site and fix any problems before it goes public, but until you change the DNS records to point to your new site, you can’t access it to test it.  To get around this, there is a clever solution, which may or may not be unique to DreamHost.  The Internet DNS tables still pointed to my old website.  I could not browse to the new one.  DreamHost solves this problem by having a process that mirrors your new website to a subdomain on DreamHost.  For epstudiossoftware.com, the mirrored site was epstudiossoftware.dreamhosters.com.  Accessing this address lets you see your website as it will look when it goes public.  This is because the mirror site is not a copy of the real site, it is the real site.  It is essentially just an alias.   Anything you do on the mirror site is actually affecting your real site directly.  So when I went to the mirror site, I was pleasantly surprised that it looked normal.  No broken links.  And faster too!

I wasn’t quite done though.  The Duplicator plugin put the mirror site address into the MySql database, not the actual site address, i.e. epstudiossoftware.dreamhosters.com instead of epstudiossoftware.com.  It is necessary to change every reference in the database back to the correct site.  There are hundreds of these references.  Tough to do manually, but, to paraphrase a saying, there’s a script for that.  This little bit of magic allows you safely to change the domain name in the MySql database.  And at this point, EP Studios was definitely working.

To complete the transfer, it is necessary to point DNS to the new location.  This is done by adding three nameservers, n1.dreamhost.com, n2.dreamhost.com, and n3.dreamhost.com, to the DNS setup for your domain.  These nameservers redirect your Internet address to the new location.  It can take a few hours for these changes to propagate through the Internet, and the main casualty during this process is your nerves, as you keep clicking on your site and your browser announces it doesn’t exist.  But then there is the time you click and the site shows up, working perfectly, and you realize you’ve done it!  Miller time!

A few loose ends to tidy things up.  I set up email for the domain, which was a very easy process that I won’t go into detail about.  It is well outlined on the DreamHost site.  Then I closed port 80 on my router, and took TomServo offline.  Actually I closed all the open ports coming into EP Studios.  No more Russian hackers for me.  It’s also nice to know that this Spring, when visiting the European Division of EP Studios in Paris, I don’t have to worry about some power failure knocking out the EP Studios site.

Addendum:  One problem I noticed after writing the above was that my original blog was in the epstudiossoftware.com/blog directory, whereas the new site used epstudiossoftware.com as the root directory.  Previously I had written a line in the root .htaccess file to redirect to the blog subdirectory.  Most external links to my posts use the old epstudiossoftware.com/blog directory, which means they give a 404 can’t be found error since the move.  Also, for some reason WordPress in generating shortlinks still generates them with the blog subdirectory!  So they don’t work.

I was able to solve this by this statement in the .htaccess file of my root directory:

RedirectMatch 301 ^/blog/$ https://epstudiossoftware.com/

It now all seems to work.

Addendum #2:  I noticed on rereading this post that the mirror site mentioned above was appearing as epstudiossoftware.com, not epstudiossoftware.dreamhosters.com as I had written it (it is fixed now).  The reason?  The search and replace script that I ran on my MySql database replaced every instance of epstudiossoftware.dreamhosters.com with epstudiososftware.com, including in the text of this post!  So sorry if you read this before and the part about mirroring didn’t make sense.

By mannd

I am a retired cardiac electrophysiologist who has worked both in private practice in Louisville, Kentucky and as a Professor of Medicine at the University of Colorado in Denver. I am interested not only in medicine, but also in computer programming, music, science fiction, fantasy, 30s pulp literature, and a whole lot more.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.