Currently, I have a blog that runs atop Tumblr, which is relatively young (3 months old or so, maybe 25 posts altogehter) that I want to migrate to a self-hosted WordPress installation. I’ve installed and configured WordPress many, many times, but I’ve never been able to figure this out. Here’s what I’d like to do, ideally:
- First, keep the existing blog up and active during the entire process
- Install WordPress somewhere public and migrate the content either by hand or using an import tool of some kind
- Install whichever theme I end up using, customize the crap out of it
- Switch the DNS for my domain so that users gradually begin to see the fully built and migrated WordPress site instead of the Tumblr site.
Here are the problems with this as I understand them:
I won’t be able to install the WordPress blog within the domain in which it will ultimately live because that domain points somewhere else. For this reason, I’ll need to install it on a different domain (test.realdomain.com or something) and do all of the import and theme dev stuff there. The bad part here is that WordPress uses the post’s full URL as it’s GUID, so I’ll have to hand-edit the database so that each post, page and media asset lives at realdomain.com instead of test.realdomain.com.
I’m wondering if, in all of my WordPress travels, I’ve somehow missed a super easy solution to this problem. For a product as mature as WordPress, I find it hard to believe that there’s no easy way to, say, build a site in a staging environment and deploy it to production without have to manually edit database tables.
Any assistance offered would be greatly appreciated, and feel free to let me know if I’ve left out any details that would help clarify anything.
Thanks!
As others have already mentioned, this can be a long process. But it can also be relatively straightforward, and I’ve done this to migrate other non-WP sites to WordPress in the past.
Export your site
First things first, you’ll need to export your site from Tumblr into a format WordPress can work with. There are a few tutorials out there on how to do this, but also one great tool built specifically for this purpose called Tumblr2WordPress.
You’ll also want to make backup copies of any images you’re using, just in case they’re lost during the export/import process.
Set up WordPress on a temporary domain
Most hosting packages allow you to access your site from a temporary domain while in development. Use this feature to set up your WordPress site and tweak all of the settings to be just the way you want them.
Then …
Import your Tumblr site
Once WordPress is up-and-running, import your old site and make sure everything is working the way you want it to.
Change the site URL
Now that WordPress is running, we want to tell it the correct domain name to use. So log in to your dashboard and go to Settings รยป General. Change both the site URL and blog URL to the values you want to use and click “Save.”
This will temporarily break your site!!! You will not be able to log back in until following the next steps!!!
Edit your
hosts
fileOn Windows, you can edit your
hosts
file to redirect domains to different locations. This will make it so, on your machine only, your site will appear athttp://mysite.com
even though it’s actually athttp://temporarysubdomain.myhost.com
.Flush your DNS
From the command prompt (i.e. DOS), run the command
ipconfig /flushdns
. This will flush your DNS resolver cache and speed things along a bit.Log back in to WordPress
If you’ve done things correctly, you should now be able to access your site at
http://mysite.com
from the computer with the editedhosts
file. Log in and make sure the site is still displaying as it should. Take a few minutes to edit any image URLs that broke in the transition and get things looking snazzy.Point your domain
Now that WordPress is installed, configured to work with your domain, and displaying your migrated Tumblr content, it’s time to actually point the domain at WordPress. Go back to your host and move the domain so it’s pointing at the right location.
Reset your
hosts
fileNow that the domain is pointed, go back and un-do the changes you made to your
hosts
file … otherwise there’s no way to know when the transition has been made (your system will always be pointing to the right site, even if the rest of the world isn’t).Crack open a beer and watch a football game
Seriously. DNS updates can take a while to propagate over the Internet, so don’t expect your re-pointed domain to work immediately. It might take 12 minutes. It might take 12 hours. This depends on your host and your ISP.
Go to your site domain
Check in from time-to-time during the football game you’re watching to see if it’s been pointed correctly (I recommend commercials and time outs … they’re boring anyway). Now that you’re running with the default
hosts
file, you should see the new site immediately when the DNS finally pushes through.Viola! You’re done
If you’ve done all of the above steps correctly, you should be done. The entire process can take anywhere from 15 minutes to several hours depending on how long it takes for your ISP’s DNS cache to refresh. I’ve used this process more than a dozen times on client sites and it works every time.
Some quick notes …
http://temporarysubdomain.myhost.com
rather thanhttp://mysite.com
. You’ll either need to create a server-side redirect to fix this, or manually edit your images. Since you only have 25 posts this isn’t a huge deal to do by hand, but there are ways to automate the process with SQL search-and-replace statements if you’re looking for a shortcut.As always, if you have any questions, feel free to ask.
Disclaimer – my experience only involves moving WP around.
First go over Changing The Site URL, it properly covers how WP stores and reacts to changes in URL as well as some tricks that make it easier.
Ignore that.
GUIDs are not meant and not used for front-end display. They act as extensive identifiers (in feeds for example), but real links that get displayed on site are formed completely separately.
I have local test stack – posts imported from blog have GUIDs with real domain, but run perfectly fine on
localhost
.Our scenario is a little different, but has some similar characteristics. We’re migrating a fairly large (500+ blogs, 14 or so domains) WordPress MU installation from a hosting provider to a new, client-hosted WordPress 3.0.1 installation. Here’s our overall plan:
If you want an after-action report, I can provide that sometime Friday (but not too early!).
There is actually no easy solution for this problem, and WordPress, out of the box, provides no way to move from development to production without manually editing the database. ๐
You may want to look at this question: How to: Easily Move a WordPress Install from Development to Production? where several ways to do it are discussed.
The super easy solution is to modify the hosts file on your workstation to point example.com to a different IP address. You can call up example.com in your browser and get the new server rather than the old, and see things just as you would if the change had propagated through DNS. This switch be simplified using a tool like
ghost
, but there are ways to do it on every platform via a hosts file.The
ghost
way:About moving from a Tumblr blog to WordPress using Ben Ward PHP script (Tumblr2Wordpress). Last time I tested it, it won’t generate title for anything except regular post. This could be solve (given a little knowledge of PHP script) by using Tumblr {PostSummary} block, which was design within Tumblr precisely to create title where there are none (for RSS feeds, among other things).
Another important point to notice. Ben Ward great script (I really mean it: it’s actually by far the best solution to move from Tumblr to WordPress) won’t import media (images for example). All images will be hot-linked to Tumblr’s servers after the importation is done. Again, this issue is easily solved using one a plugin after the importation that will allow the WordPress blog to automatically download hot-linked images.