Moving Website Hosting Pt 3/3 – Drupal-based Sites
Drupal Multi-Site Setup
Now it’s the turn for a Drupal site to be transferred. This site is for testing to see if there’s any problem during and after transfer. If successful, the rest of other sites will move too.
I am going to keep multi site configuration as I always had. With this I only install a single copy of Drupal codes for as many domains as I have. Very handy if you run more than just a site or two. You will immensely appreciate this simplicity when it’s time to upgrade the codes from old to new version. This benefits extend to modules and themes too. I only ever worry about one set of codes that cater for all sites that I own.
Another great thing is – it doesn’t stop you from managing every site of yours differently from one another, as if they run on their own set of codes. You could for example have specific themes for each and every site if you like so they all look differently. Brilliant.
Compare this with other CMS where I have been upgrading one site at a time and I tell you that it was absolutely tedious. In fact, I have not upgraded all my WordPress sites to the most current version available due to this. Most of my sites are still at 2.5 if not 2.3, just too bad since this is considered a serious security risk. Just imagine if you have more than just a handful of sites to maintain.
Ok, enough preaching so let’s continue with the transfer process.
Do the Upgrade Later!
I’ve made a mistake here. As I wanted to upgrade to Drupal 6.4 from 5.7 I had earlier on, I uploaded 6.4 codes to the new server. Then the database get created and imported and settings.php updated and then run the browser to see.
Oh no what a mess! The site it’s not what I expected to see and it’s not nice at all.
I then deleted the database, files and folders and upload a fresh copy of Drupal 5.7 codes. Created the database again and did Import. Same old mess!
After some soul searching, I realized that the codes from the old server should have been copied and uploaded instead. As this will eliminate any hidden compatibility issues that Drupal doesn’t like. I did just that and voila! It works.
The rest is then super easy. Import the remaining databases and examine settings.php for each site. All should be up and running. So far so good.
Summary
Here are the steps involved if you’re moving a Drupal-based site to a different hosting:
- Backup the associated database from your old server to the local machine. You can either use cPanel>Backup>Databases or cPanel>phpMyAdmin>Databases>Export.
- On the new server, do cPanel>phpMyAdmin>Databases>Import. If the backup is a plain text file, you could choose cPanel>phpMyAdmin>Databases>SQL and paste the content of the file into the form field.
- Download a copy of the Drupal codes from the old server to your local PC.
- Upload it to the new server.
- Update settings.php file within /sites folder to reflect the new database and URL in these two lines:
$db_url = ‘mysql://username:password@localhost/databasename’;
$base_url = ‘http://www.example.com’;
Ok, we are done with the database and the codes. If you’ve updated the DNS to point to the new server, you can now enter the site URL into the your browser and the site should load up as expected.
It’s now time work on the rest of the domains…and it looks a lot less intimidating now that the first one was done successfully.
Lessons Learnt
- Move your primary domain last. Its’ the one that you register your hosting with.
- Use the original codes and database i.e. download them from your old server to be uploaded to the new one as is. Don’t try anything fancy here, yet.
- Work on a single site or two the most at any one time to avoid mix ups.
- Transfer your less important sites first and move up the ladder. This is to avoid disruptions to your most valuable sites and let you learn step-by-step. It’s best if you use an idle domain to test the water before touching your live and more important sites.
- Postpone the urge to upgrade until the transfer is over and everything runs as expected.
Yey, I’m Back To Normal!
From all these, I still have one question remaining to be answered. What could happen if my old and new servers run different versions of PHP and mySQL just in case?
I consider myself lucky as both the old and the new servers have version 5 otherwise things might have turned less cheerful.
This time, I hope my new hosting won’t slap me with any restriction that they could have written in that lengthy TOS. Based on an earlier chat communication, they pose no restrictions to the number of files residing on the server beside unlimited storage and bandwidth.
But at least for now, I am as happy as ever – having all my sites found their new home(server) and I can continue doing the ever more important thing… building of my business! Cool.
{openx:16}



Leave a Reply