So far everything seems to be working with the new blog, so I thought I’d do a post about some of the issues I had moving everything over from Blogger to WordPress. Be forewarned that the steps I took below came from a mixture of skim reading websites, asking friends and trial and error, and should not be taken as me knowing what I’m doing. Enjoy!
1. Installing WordPress
WordPress has a “famous 5-minute installation” guide, though I’m not sure what it counts as installing because uploading 7-8 MB of files over FTP takes up quite a lot of that time. Anyway, putting WordPress onto the site was pretty straight forward – the one minor problem I had was I originally missed the security keys section of the WordPress configuration file, probably because the instructions that tell you to do so are written after a long list of options you are told to leave alone.
Once the blog was up I started looking for options to tweak. I tried changing the permalinks to be categorised by year then date, but WordPress didn’t have the access rights to the .htaccess file. I think this is because I uploaded all the files through ftp, and therefore all the rights to the WordPress files and folders were assigned the FTP user. This wasn’t too much of a problem at this stage because WordPress helpfully gave me the code it wanted to put in my .htaccess file, so I could do that myself.
2. Importing Blogger posts
The next step was to get all my old posts imported in. This was much less straightforward. There’s a handy import tool, but in order to use it WordPress wanted to create some new folders and ran into the same access rights issues as before.
What I did:
- Tried to upload a picture using WordPress (which failed due to the access rights issue). Noted down the location of the folder it was trying to make.
- Created that folder using FTP and granted full access for everyone to it (777 access). Uploaded the picture again – successful this time because everyone could now write to this folder (which would be a security risk if I had left it like this).
- Connected to the actual web server (which fortunately I can get access to). Noted down the user that owned the picture I had just uploaded (this is the user that WordPress is using to interface with the server).
- Removed the picture upload folders.
- Created the folders WordPress needed for the import. On the web server changed the ownership and rights to give the WordPress user enough access over the folder.
- Performed the rest of the import.
What I now think I could have done:
- Manually create the folders WordPress wanted to write to using FTP.
- Use FTP to grant full access rights to everyone (777 rights) on the lowest subfolder created.
- Perform the import.
- Use FTP to change access rights on the folder back to how they used to be and/or delete the new folders
WordPress doesn’t seem to put anything in the folders (blog posts are stored in a database rather than as physical webpages), so I’m not entirely sure why it needs the folders creating. My guess is it’s some kind of staging area to temporarily store the blog posts before converting them and putting them into the database. Anyway, the point is as far as I can tell WordPress needs access to the folder to perform the import, but doesn’t need access afterwards, so you can open up a security hole then close it later. I’d have to put a bit more thought into permissions if I wanted to use WordPress to upload files (e.g. pictures), but I’m happy doing that through FTP so it’s not a problem.
Now that I had folders WordPress could write to all I had to do was run the import tool. There’s a built in Blogger import option, so I ran that. It seemed to go fine, asking for my Blogger details then giving my website access to my Blogger account, but when it actually came to pulling data back it seemed to think I had three blogs with no posts in. Instead I went to Blogger and exported my posts from there, used this online tool to convert them to WordPress export format and imported them as WordPress posts. This worked fine for me, but something must have gone wrong when a friend of mine did the same thing as he somehow ended up with half of his blog and half a blog about baby care products. Moral of the story is check (at least skim read) through your posts to check that everything’s there.
3. Redirecting pages
Wanting to do things properly I decided I needed page redirection, so that anyone clicking a link to my old blog would be taken to the correct post in the new blog. I thought this was going to be reasonably easy because old Blogger posts were “/blog/year/month/postname” and new WordPress posts are “/news/year/month/postname”, so I thought all we had to do was take a request for /blog/blah and redirect it to /news/blah. Unfortunately there are a couple of differences in the way Blogger and WordPress post. For starters all Blogger posts have .html on the end of them, whereas WordPress doesn’t, which means a simple folder redirect doesn’t cut it. The following lines in an .htaccess file fixed this (thanks go to my friend Steve for writing this code)
RewriteEngine On
RewriteBase /
RewriteRule ^blog/([0-9]+)/([0-9]+)/([A-Za-z0-9_-]+).html$ news/$1/$2/$3/ [R]
RewriteRule ^blog/blog.htm$ news/ [R]
RewriteRule ^blog/$ news/ [R]
Second problem is that when you post to Blogger it cuts out short words such as “the”, “a” and “an” from your post permalinks (so my post “The cat, the player and the cupboard” was given the Yorkshire sounding permalink “cat-player-and-cupboard.html”). WordPress’ converted posts had the full title (“the-cat-the-player-the-cupboard”). I’m sure there’s some clever script you could write to go through all your posts removing these short words and their extra hyphens from blog links, but seen as I only had 30-odd posts I just changed the links on the affected ones manually to match the original Blogger links (minus the .html of course).
4. Making the final move
So I have a working WordPress install with all my previous posts imported in and redirects in place so that anyone trying to get to an old post will find the new version instead. As soon as I put the redirects in place visitors to my website should no longer be able to get to any of the pages of my old blog, but it’s probably a good idea to change all the links in the rest of the website to point to the new addresses.
The final issue is the RSS feed of the old blog. I don’t think you can redirect RSS feeds, so anyone reading posts solely through the old RSS will stop getting updates and therefore stop reading. So, the last thing to do is make a new post on Blogger informing people that the blog has moved and asking them to update their RSS feeds. Remember that people won’t be able get to the actual Blogger post because of the redirects, but their RSS readers will still pick up the post from Blogger’s feed. I also made a post on the new blog with a matching permalink so that if they click to view the post the RSS came from they’ll be redirected to a welcoming page on the new blog.
What I should have done from the start was use Feedburner to ‘burn’ my RSS feeds, then offer the Feedburner feed for people to subscribe to instead of the actual website feed. In other words, people subscribe to Feedburner, which then fetches the actual feed generated by my blog for them. If I had done that I’d have been able to point Feedburner at the new RSS feed and wouldn’t have lost any subscribers. I didn’t know about Feedburner when I started my blog, but that’s what I’m doing this time around.
* * *
Whew, that was a long post. I don’t know if any of that was useful, but hopefully someone will find it interesting. Now that I’ve got WordPress up and running I intend to blog a bit more often (which blogger hasn’t said that?) so we’ll see how that goes.