Having your own blog is easy, especially if you use a free blog platform like WordPress. Before I get into moving your WordPress blog though, in case any of you don’t know how to create one in the first place, here are the quick and easy instructions:
1. Get yourself a domain name (register one at Godaddy).
2. Get a hosting account (Dreamhost is cheap and easy to use).
3. Add your domain to your account at Dreamhost in the “Manage Domain” section.
4. Change your “nameservers” on your domain at Godaddy to the ones Dreamhost gives you.
5. Click “Goodies” in your Dreamhost control panel, select “one click install”, use the “advanced” installation, choose WordPress, and follow the instructions. Bam! You’ve got yourself a blog. Moving it to a new domain is another story though! Here’s how to do so and avoid all the mistakes I made on my first blog move:
Moving your WordPress Blog
You must follow the steps below in the EXACT order they are presented, or risk having your blog flushed down the toilet. Yes, you may be able to rescue it, but you’ll likely have poo poo all over your body from climbing around in the sewer.
1. Save a backup copy of ALL your files and your database. Filezilla is a great FTP program you can get for free, and use to copy your “blog” folder to your hard drive. Then, export your database to a file on your computer. To export your database from Dreamhost, just go to “databases”, log into phpMyAdmin, select your database, select export, and use the following settings:
The above will make a copy of your old blog files and database. It’s a good idea to have this in case your move fails and you need to start over.
2. Go into the admin section of your blog, and change the domain in the “settings” to the new location where you want your blog to reside.
3. Go back to Dreamhost and export the database AGAIN, to a new file. This time, the database is going to use the new domain that you switched to in step 2 above.
4. Create a new database on your new domain/server. This should be a very easy step. Just go to the database portion of your control panel and select to create a new database. Take note of the database name, userid, password, and host/location.
5. Import the database you exported in step 3 (your old database files) to the new database you just created in step 4.
6. Go into your blog files you have on your computer (which you moved in step 1), and find the wp-config.php file. It will be at the root level. Open the file with Notepad, and change the database name, userid, password, and host/location to the new info you made note of in step 4.
7. Move the entire “blog” folder onto your new domain wherever you want it to reside. If you want it to be at www.site.com, move all the contents of your blog folder directly onto the root. If you want it to reside at www.site.com/blog, just move the entire folder names “blog” onto the root.
The shorter and harder to follow WordPress instructions will tell you you’re done now…but you may not be!
I’ve run into two additional problems:
1. If you’ve moved from the root directory on one domain to a “blog” directory on another domain or vice versa, you may have to modify your .htaccess file, ESPECIALLY if you’re using custom permalinks…which you should be! WordPress will need to redirect their crappy URL’s to your custom permalinks, and it needs to modify the .htaccess file to do this. But, it may not be able to modify the .htaccess file if it’s in a different directory. So you’ll need to go to the permalinks section of WordPress under settings, select the “custom” box, put in your custom link structure (which should ideally be: /%postname%/), and copy the .htaccess code that will apear at the bottom of the screen to paste into your .htaccess file if it WordPress wasn’t able to do it.
2. Your “file permissions” may have changed when you uploaded them to your new server, and WordPress may be unable to access folders it need to be able to access. Using Filezilla (FTP), set your folder permissions to 755 and your file permissions to 644. This SHOULD allow WordPress to function. If you have problems with image uploads you may have to temporarily go into WordPress and increase the accessibility of your uploads folder to the likes of 777. BUT, only do this temporarily, as it will allow hackers to upload malicious scripts in your comments!
Finally, go back to your old domain, and upload a new .htaccess file that redirects users and search engines to your new blog. You can use this code if your blog was in the root directory:
RewriteEngine On
RewriteRule ^(.*)$ http://www.site.com/blog/$1 [R=301,L]
Change blog/ to wherever your blog is now, or leave it off if your blog is going to be in your root directory again. If you’ve got any questions, feel free to ask them in the comments. Happy blogging!



Post a Comment