Who solved my website migration nightmare
- May . 6 . 2009 | Category: Personal Blog |
- 7 Comments
When your web hosting company closes you down unexpectedly, that’s one big challenge. When you’ve got 50 sites, that’s a huge challenge. When something goes wrong with the process of restoring the backup files for 50 sites, THAT… is a nightmare.
And that’s what I’ve been wrestling with these last few days.
Here’s why.
My old host suspended me for having too many files on my unlimited disk space hosting account. Yep, it’s in the fine print that you cant have too many files… but it would have been nice if they had given me the 14 days they wrote to me about. It was 14 days to remove the excessive files or they would close me down. TWO DAYS LATER, they suspended all my sites. Not nice, if you ask me.
Well, I asked them to change their mind but they said no. Next I asked for FTP access (so I could download my web content) and CPanel access (so I could download the .sql files) to my content on their servers – and they said yes. So I busied myself with a great deal of downloading. Remember that’s 50-something sites.
Then at my new hosting (which is with Hostnine), I used Fantastico to create a new WordPress blog at each of my blog sites… which is most of my sites. Think: big big job. Lots of sore back time.
Well, for this story, let’s just use one example… garyharvey.net, this site.
STEP BY STEP
Fantastico installed a new WP blog, just the default blog with the boring Kubrick them. But it was working, so… we’re doing okay so far.
Then I uploaded my favorite WP theme and activated it. Still going okay.
Next I uploaded and activated the handful of WP plugins I use. Still OK.
Now, I wanted to restore the original content… all the blog posts I’ve put here at garyharvey.net over recent times. Well, you do that by creating a new MySQL database and user. Assign the user all privileges. Then use PhpMyAdmin to import the old .sql file (the one you downloaded from the previous host). That went okay too.
But if you dont connect the new blog installation with the information in the old database, you wont see those old posts at the new web address. In theory, that’s a simple enough task — just open your blog’s wp-config.php file and tell WP where to get the info you want it to display.
Remember here, the new database contains your old posts, comments, categories, etc which you’ve imported from your earlier webhost.
So I opened the wp-config.php file and entered the new database name + username + password. BUT when I refreshed the site, I got an error message…
"Fatal error: Call to undefined function wp() in /home/ghnet/public_html/wp-blog-header.php on line 14"
WHAT TO DO WHEN YOU GET AN ERROR MESSAGE
The rational thing to do when you’re hit with error message like this is to copy and paste the message (minus the ghnet bit because that’s unique to me) into Google and see what others are saying about it.
Over 16 thousand results.
MEET THE MAN WHO SOLVED MY WEBSITE MIGRATION NIGHTMARE
After much reading and a bit of posting at several forums, one kind helpful and spot-on gent finally gave me what I needed to know. The helpful expert was Steve Wolfson whose site is http://mountainwebdev.com. He is a website developer and web designer. This is my way of saying thank you Steve.
You can read the thread including Steve’s answer at http://wordpress.org/support/topic/267962?replies=5#post-1066017
SIMPLE SOLUTION
At the end of the day, it was as simple as adding these 2 lines…
define('WP_SITEURL', 'http://garyharvey.net/');
define('WP_HOME', 'http://garyharvey.net/');
…into my wp-config.php file. But when you dont know what to do, it’s a nightmare. I hope this rather long post turns out to be helpful to others. Or if not, then at least interesting.
As a postscript to all this…
WEB HOSTING ON MULTIPLE IPs
In case you’re wondering why I chose Hostnine, it’s because their reseller account lets you host your web sites on multiple different IP addresses. And that means my sites can now be spread out all over the world (not all sites on one server which is the typical way that unlimited domain hosting plans work). That in turn means I can now get increased linking power when I create non-reciprocal linking between my sites. Interested in learning more? –> http://garyharvey.net/links/h9 and look for the reseller account info.
Cheers,
Gary Harvey
http://GaryHarvey.net
Feel free to post your comments. You are welcome to reprint this post.
Instant SEO from Rom Machine 6th May 2009 9:38 pm
Nice information.
Instant SEOs last blog post..Rom Machine a Review
Terry from Scrub Tops 11th May 2009 8:32 pm
Good thing you know your stuff. More than half of the steps you’ve done I can’t even comprehend.. just yet. LOL. This just shows how hard I need to study my WordPress. LOL
Todd 19th June 2009 6:48 pm
Hmm. I tried all these steps, and it didn’t work for me when using the same concepts to create a mirror site of my blog. I’m still stuck at the “Fatal error: Call to undefined function wp()” line 14.
There is one key difference: From phpMyAdmin, I copied my WordPress database from username_wrdp4 to username_wrdp3.
From that point, I created a new user and password, modifying my wp-config.php file to reflect those changes. Finally, I updated wp-config.php defining a different domain name.
I really didn’t want to spend 4 hours on this, but it looks like it’s gonna take another 4-8 hours to understand how to do this.
HostingRef 23rd June 2009 11:55 am
Glad to hear that you were able to find a new host and someone helpful enough to point out your problem. It is amazing how a few lines of code can fix things up.
Fernando from Templates Blogger 24th June 2009 5:09 am
Thanks for share.
I’m usually have problems when i do a website migration… Some times it’s just one letter… but one letter can create problems for a day.
Mikael Kristiansen 25th June 2009 6:55 pm
Hi Gary
Thanks a lot for great explanation. I just ran into the same problem migrating a WordPress site to a new server, and the two additional lines in the web-config file saved me a headache.
Regards
Mikael Kristiansen
dave miers 19th March 2010 12:21 pm
i love* you at the moment.
thanks for sharing
so so helpful.
* yep – love isn’t too strong a word!!