By Flexo

I am a long-time DreamHost customer. I still recommend them to my friends who want to create simple websites that will never attract much traffic, but not to business clients who are interested in having a major web-hosted application that can support 100,000 pageviews or database queries an hour.

As my most popular website, Consumerism Commentary gained popularity, DreamHost was having trouble keeping up with the processing demand (for a reason that will become clear later on). I’ve been hesitant to move to dedicated hosting. Don’t get me wrong, I can afford it based on web income alone, but I was still skeptical about why a simple blog was putting so much strain on a server.

I decided I would sign up for Dreamhost’s “Private Server” program, which is a new product they are rolling out. Customers receive virtual dedicated service, which means no other sites can supposedly affect their performance, but smaller maximum processing power and memory. Virtual private servers are supposed to be better than shared hosting, so I signed up, awaiting for the call.

September call-ups finally came around, and they moved all of my sites — something like 20 separate websites — to DreamHost PS. From there, everything went downhill. Even at the maximum CPU settings at a guaranteed 2300 MHz, DreamHost could not handle the load. Performance was much, much worse than the day before on DreamHost’s shared hosting.

I needed to fix this immediately. DreamHost support was marginally helpful. Their suggestions were to install wp-cache 2 (which was of course already installed) and to scale back my other plug-ins on Consumerism Commentary. I did scale back but there was no change in performance.

I had worked a little with MediaTemple before and knew their “gridserver” system might be good for an interim work-around. I set myself to work moving just the one blog, Consumerism Commentary, from DreamHost PS (at the cost of anywhere from $15 to $230 a month) to MediaTemple ($20 a month).

Step 0. Back everything up. This is only in here because it’s good practice. I knew that DreamHost can pull back-ups at any time, so I didn’t bother doing anything here.

Step 1. Open a hosting account with MediaTemple. I opened my new account with the domain name already in use in under 5 minutes. Once receiving my password, I used the MediaTemple control center to activate a Unix shell user, change my settings to use PHP 5 and MySQL 4.

I can access this new site using a special subdomain assigned by MediaTemple. This is how I was able to check the availability of the new website before officially changing the DNS settings for consumerismcommentary.com.

Step 2. Create new e-mail addresses. Also in the control center, I created e-mail addresses to match the ones I had set-up at DreamHost. This way, I would lose no e-mail in the transition.

Step 3. Move the files. I logged into DreamHost using PuTTy (ssh) and gzipped a tar of the entire consumerismcommentary.com domain. There’s a lot of extra junk in there, but I can go through it and delete what I don’t need some other time; at the moment, I was only concerned with getting the site up and running as soon as possible. I ftp’d directly from my Dreamhost PS server to my new MediaTemple server and ungzipped the tar in the appropriate location.

Step 4. Create a MediaTemple database for WordPress. In the MediaTemple control center, I added a new database for my WordPress entries, comments, and all other data. I then used the phpMyAdmin interface on the old database to export the tabled needed. The export was performed in “SQL” format, using MYSQL40 compatibility mode, and with a very high maximum query length.

I saved the results in raw text as “export.sql” on my local hard drive and then uploaded it to the MediaTemple server. I then logged into my MediaTemple server via ssh and executed the following command:

mysql -h mysqlhostname -u username -p < export.sql

Success! My database was now replicated on MediaTemple. But I didn’t want to lose any comments if someone should happen to visit the website and leave one during this transition, so I modified my MediaTemple database’s settings to allow connections from dreamhostps.com and dreamhost.com. I also changed my database settings in the wp-config.php file on DreamHost to access the new MediaTemple database.

Step 5. Test everything. I tested my site on DreamHost, which was still unresponsive, and on MediaTemple using the temporary gridserver.com subdomain they provided. Everything was working, in fact, the MediaTemple server was flying. I expected that, as the only traffic it was seeing was my own.

It was time to change the DNS settings so people visiting my real URL would see the new site.

Step 6. Change the DNS settings. MediaTemple provided me with nameservers that should be used in my domain’s settings, to replace DreamHost’s nameservers. I logged into my GoDaddy account center and made the changes.

I added the following line at the top of my .htaccess file on DreamHost to start ensuring that no one was visiting the DreamHost site any longer:

RewriteRule ^(.*)$ http://subdomain.gridserver.com/$1 [R,L]

While the DNS settings took 24 hours to fully propagate, those finding their way to DreamHost would find themselves visiting MediaTemple via the subdomain provided. Eventually, they would receive new resolution instructions for my domain name, and the transition would be seamless.

That’s the end. That’s all it took to move my large WordPress blog from DreamHost to MediaTemple. I can’t quite understand why MediaTemple’s hardware can handle Consumerism Commentary, but DreamHost’s virtual private server cannot. While MediaTemple doesn’t let me run useful Unix tools like top and uptime, their control center does give me a perfect breakdown of exactly which scripts/URLs are causing heavy loads.

I determined that a missing JPG was causing a huge strain on the server. This is likely the issue that crippled DreamHost, but it did not visibly affect the MediaTemple server. DreamHost could not even tell me that this was the issue causing the server strain; if they had, I would likely just have fixed the image and things mighty have returned to normal. MediaTemple’s tools let me see that this missing image was for some reason eating up much more CPU than would be normal.

The solution: I restored the missing image.

Regardless, I’m happy with Consumerism Commentary’s performance at MediaTemple, but I do have some issues connecting from my office. My employer has a poor connection to the internet backbone, and connecting to sites that are not hosted by major media hosts like Akamai that cache static pages at hubs all around the world has always been a problem.

I will still move to fully dedicated hosting for all my sites in the future, but this move has delayed that need for some time.


No Responses to “The Simple WordPress Transition From DreamHost to MediaTemple”  

  1. No Comments

Leave a Reply

You must log in to post a comment.


Categories