How to migrate your wordpress to tumblr. Including images and comments.
So I’ve decided to move my wordpress blogs to tumblr. Although apparently TechCrunch thinks that’s a bad idea. And although Moritz Adler would kill me for that. (Although: He doesn’t have a personal blog and hence has no licence to kill me). Anyway. With tumblr I don’t need to host a blog software myself. And I don’t end up having my blog hacked and then seeing my blog being displayed as a malware site in Chrome/Firefox (happened to me twice). And then with tumblr I create new blogs with subdomains within minutes. Cool stuff. Hail to the cloud, baby!
So here you go: A complete guide how to fully migrate your wordpress blog to tumblr. Including comments and pictures. And still supporting your old url scheme.
Update: I ran into a tool that claims to do a lot for you: import2.com/tumblr. It doesn’t migrate images and 302 redirects. Not sure about comments migration. And it costs 24$. Still, if you can leave out some of the steps below that’d be worth the money. Comments of the author on quora
Before you start to actually move your blog, you need to consider a few things:
If you have a wordpress webhost, then this webhost most probably also does DNS for you. You need to replace that by a third party solution. I think these are good services:
- he.net. Free service. No strings attached. The one I’ve chosen. The interface is nice and very easy to add new CNAMES, MX records, etc. The uptime was reported to be not so good, but I don’t really care about uptime of my blogs. To host your tumblr blog on your domain, you add a
domains.tumblr.comand then configure your tumblr blog to listen to that domain. Very simple.
- Amazon Route 53: They charge you $0.50 per hosted zone per month. That’s a fair price and probably has a better uptime then he.net
At default they’re all located under
www.yourolddomain.com/wp-content/img1.jpg. To completely get rid of your old web host you need to move those to a different image hoster. I don’t advice you to upload it to tumblr because if in future you want to move away from tumblr you run into the same problem again.
Do you have comments at all? Tumblr doesn’t support comments by itself. Most themes have disqus support. Moving comments to disqus is no big deal, but still it’s some work, so you may decide to just not migrate comments.
Wordpress’ url scheme generally is e.g.
That same post ends up at this tumblr url:
howto.pui.ch/post/37471154429/print-hello-world. Note that the last part of the url is optional, i.e.
howto.pui.ch/post/37471154429 works as well.
If you care about incoming links to your blog not to break and if you care about your google ranking (I guess 302 redirects inherit the google ranking), there are two possibilities:
- Stay on the same domain, handle the redirects in tumblr (tumblr supports that with the pages’ type “redirect”)
- Move to a different domain and put up e.g.
redirect permanentin a .htaccess file on your web server
At a glance, that what you’ll do:
- Upload your images to a different hoster (if you want to get rid of your old webhost)
- Extract all blog posts+comment from wordpress
- Fix the export.xml: Replace images, more-tags and fix some additional stuff
- Migrate your wordpress blog to blogger
- Migrate your blogger blog to tumblr
- Install http redirects (on old webhost or on tumblr)
- Migrate your comments to disqus
- Clean up blog posts (might be a biggie if you’re a perfectionist)
Alright, let’s specify those 8 steps.
If you’re ok with keeping your old webhost you can skip this point. Easiest thing to do would be to copy your wp-content directory one to one to a different hoster so
www.yourolddomain.com/wp-content/img1.jpg turns into
I don’t have experience with image hosting providers so I just uploaded my images to picasa, but that meant I needed to update every single image in all my blog posts to the new image url of picasa. That was quite a pain. I couldn’t find a image hoster yet who meets the criterias above. Photobucket doesn’t, Dropbox doesn’t, Google Drive doesn’t. Maybe Amazon S3
- In your wordpress admin go to Tools → Export. On my blog that was
Download Export File.
You have just downloaded an xml file, in my case the name was
coderandom.wordpress.2012-12-13.xml. Open that file with your favourite text editor. Now you need to do a few things before you can go on:
- Replace all <!–more–> by [[MORE]]. The uppercase actually matters. [[MORE]] is the divider that tumblr actually understands as the place where you want your excerpt to stop in the blog overview view.
- Replace all images by the new urls you got by uploading the images to the image hoster in step 1. It’s much easier to do this at this stage than to replace the images once you’ve migrated your blog to tumblr.
- You may have more wordpress plugins you used in your posts. I used
[python]...[/python]to syntax highlight my python markup. I’ve moved to google code prettify which needs
<pre class="prettyprint">...</pre>as a syntax. So I needed to replace all occurrences by the new markup. Obviously, regex is your friend at this stage.
Unfortunately there’s no direct way to directly import this xml file into tumblr. Instead, that’s what you need to do:
Convert your xml file on this website to a file fit for importing into blogger.
This doesn’t work for files bigger than 1MB. If that’s the case then you can either convert the file on your own machine using this sourcecode on google code.
Create a new blog on blogger.com.
In blogger navigate to your new blog and do settings → other settings → import blog
Publish all blog posts: Posts → All → Select all → Publish
If you have difficulties in this step you might try a different solution (didn’t try any of these):
- Go to bloggertotumblr.com and enter your url for your newly created blogger and tumblr blogs. The conversion is very straight forward.
- Delete your blogger blog
- Enjoy. Your blog posts are now on tumblr. Still missing: Support of the old url scheme and comments
In the section before you start I asked you to decide if you’re ok to break your old urls. If you don’t care, then skip this step. Although: if you care about keeping your comments then you still might to do this step, as it makes migrating comments to disqus a lot easier
If you do care, then:
- If you keep the domain of your blog: You need to install tumblr redirect pages. See below.
- If you changed the domain of your blog: You need to install redirects on your former wordpress webhost. I describe how this is done via .htaccess config below
- go to your new tumblr blog
- click customize top right
- add a page (left column)
- instead of “Standard Layout” choose “Redirect” and add a posts’ old url on top, and the new url on bottom. Repeat this for every blog posts (yeah, lots of work here)
IMO that’s a bit simpler than installing a tumblr redirect for every blog post. Still it’s a lot of work since you need to come up with a map of old_url → new_url for every blog post. If your webhost supports .htaccess then go for this method. Most probably you have such a file already for your wordpress installation.
An example of a .htaccess file:
RewriteEngine On Redirect permanent /page/2/ http://howto.pui.ch/page/2 Redirect permanent /feed/ http://howto.pui.ch/rss RewriteRule ^$ http://howto.pui.ch/ [R=301,L] Redirect permanent /2007/02/25/add-bandwidth-to-a-file-download-in-python/ http://howto.pui.ch/post/37471156141/add-bandwidth-to-a-file-download-in-python Redirect permanent /2007/06/08/python-find-out-cpu-time-of-a-certain-process/ http://howto.pui.ch/post/37471156554/python-find-out-cpu-time-of-a-certain-process Redirect permanent /2007/07/23/python-sort-a-list-of-dicts-by-dict-key/ http://howto.pui.ch/post/37471157116/python-sort-a-list-of-dicts-by-dict-key Redirect permanent /2009/12/30/dealing-with-mysql-backend-does-not-support-timezone-aware-datetimes/ http://howto.pui.ch/post/37471158729/dealing-with-mysql-backend-does-not-support Redirect permanent /2011/01/19/python-easy-way-to-show-progress/ http://howto.pui.ch/post/37471159741/python-easy-way-to-show-progress Redirect permanent /2012/07/17/how-to-detect-a-files-character-encoding/ http://howto.pui.ch/post/37471161169/how-to-detect-a-files-character-encoding Redirect permanent /2010/04/04/python-display-refreshing-status-like-top/ http://howto.pui.ch/post/37471159398/python-display-refreshing-status-like-top Redirect permanent /2011/11/03/how-to-switch-gnu-screen-windows-in-iterm2-via-keyboard-shortcuts/ http://howto.pui.ch/404 Redirect permanent /2007/01/19/sched-20-pizza-is-ready/ http://howto.pui.ch/post/37471155110/sched-20-pizza-is-ready
Note the first 3 lines, you will need the same for your redirects. Note the special syntax of line 3. That is important to not redirect a non existing url to the new domain.
Wait! I just moved my blog away from my old webhost, and now I need to keep it to have http redirects in place?
Uh, yes. Alternatively, you can move to a free hoster like google apps engine and e.g. use this to redirect. Or you just wait a few months and wait until all search engines have digested your redirects and kill your old webhost only then (that’s what I’m probably gonna do).
Because tumblr doesn’t offer comments by itself you need to migrate your comments to disqus:
- Register your new tumblr blog url at disqus
- On disqus go to
Upload WXR. Choose the XML file you downloaded from your wordpress installation (not that got converted for blogger). Upload that
- On the same page go to
Migrate Threads. Choose “Redirect crawler” if you installed the redirects in step 6. Otherwise you need to use the “Upload a URL map” option
Voilà! After a few minutes your comments should appear in your new tumblr blog.
Might be that the html markup of my wordpress posts were so bad, but I needed to fix a lot of spacing between paragraphs. I also had some CSS tweaks to right align the images which I needed to fix.
Lastly, blogger adds these paragraphs to the end of every blog post:
<div class="blogger-post-footer"> <img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/290349385069691835-5946149615494229188?l=coderandomm.blogspot.com" width="1"> </div>
If you are a perfectionist you may want to remove this markup from every blog post.
A word of caution: You can spend a lot of time at this step if you overdo it.