For those of us who host our own blog or website, it is inevitable that it will have to be moved. First, you might need to move your blog if you are switching your web host. And second, you might also need to ‘move’ your website if you are transferring it to a new domain, new directory, or creating an alternate version on a local server.
Use the links below to navigate to the appropriate set of instructions.
⇒ Move WordPress to a New Hosting Package
⇒ Move WordPress to a New Directory
⇒ Move WordPress to a New Domain
Believe it or not, this is the easiest type of move. And there are two main ways to go about it.
Method 1: Use WordPress’ Built-In Import
WordPress features a built-in import to facilitate the process of moving content from one blog to another. And there are only three steps that you need to follow to get you blog up and running.
Method 2: Work Directly With The Database
Sometimes, due to hosting restrictions, or based on the size of your export file, Method 1 will not work so well. So now, you’ll hear about our preferred method. For this, you will need database access, (often phpMyAdmin,) and a little more technical knowledge.
To move WordPress to a new domain requires a few more steps. As with the steps mentioned above, you will probably need to physically change the location of your WordPress installation. In addition, you will also need to update your WordPress settings and permalinks.
The move to a new directory is likely easier than moving to a new domain. Here are the options that we suggest:
Option 1: Move Files
Option 2: WordPress Import/Export
You can also opt for the WordPress Import/Export file method given above as Method 1. If you choose this method, you will also have to update your permalinks using the Update URLs plugin.
Option 3: Only Change URL
Sometimes, it is not possible to change the physical WordPress directory. In these cases, you can change the url by simply updating WordPress settings. To do this, go to Settings -> General. Here you will find two settings: WordPress Address and Blog Address. By updating only the Blog Address, WordPress will ‘map’ to the new directory. Note: You will need to move the index.php file to the blog address directory.
Likewise, there are multiple ways to move to a new domain.
Method 1 - revised (WordPress Import)
To move to a new domain, we suggest Method 1 above. If you have a lot of posts, this may be tricky as the export tool has been known to ‘timeout’. However, you might be able to create multiple export files by creating one file per author. The only modification to method 1 is the step below.
4. Update permalinks. Upload and activate the Update URLs plugin. Go to Settings->Update URLs and enter the appropriate settings to update all of your links.
Method 2 - revised (Database)
Similarly, you can also opt to work directly with the database, as in Method 1. If working with the database, you will have a bit more technical work on your hands. See step 4 below.
4. Update settings with SQL. One you have successfully imported the database, you will need to update some settings to make the website functional. SQL sample queries are listed below.
Sample Query To Update WordPress Settings
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-url.com', 'http://www.new-url.com') WHERE option_name = 'home' OR option_name = 'siteurl';
Sample Query To Update Permalinks
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-url.com','http://www.new-url.com');
Sample Query to Update Any Links Embedded In Content
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-url.com', 'http://www.new-url.com');
Sometimes, you might have omitted the www from your domain when cross-linking posts or referencing images, so you should also run the above query without the ‘www’ for your old domain.
For more information on changing the website url, see http://codex.wordpress.org/Moving_WordPress and http://codex.wordpress.org/Changing_The_Site_URL.
Tags: blogs, content management system, WordPressTrackback URL for this entry:
http://www.velvetblues.com/web-development-blog/how-to-move-a-wordpress-blog-or-website/trackback/
Contact us today for a quote. Click here to submit details regarding your project.
If you are making a general inquiry, send an email to info@velvetblues.com
Hrmm, I didn’t know you need the “update urls’ plugin to transfer a wordpress blog.
Only if you want all links and image urls to be updated. It will work fine without, but will often necessitate a lot of extra work.
I tried your plugin to move my Wordpress blog to a new domain and now its just forwarding to the new domain with no content.
Is there a way to undo the changes I did to the permalinks through ftp? I cannot get back into the wordpress admin…
Hi Kramer,
This plugin doesn’t update any core settings. So this change that you are experiencing is because you’ve updated the WordPress urls under Settings->General.
To move a website to a new domain, you cannot just update settings. You also, generally, have to move files. Can you move the files to the appropriate locations via Ftp (Do not delete anything.)
(This plugin fixes one small problem, that of content and image links not updating after a move. But does not affect core settings.)
So, here’s what I’d do if I was in your situation:
1. Copy/Transfer all files to new destination.
2. If it doesn’t work, go into the database to reverse the settings…
Well first of all, I’m not trying to move any files. I’m leaving it on the same hosting and only changing the domain name. How do I reverse the settings in the database? Thanks in advance!
Scroll up and look directly under the subheading:
“Sample Query To Update WordPress Settings”
Except in your case, the new and old urls would be reverse. ie. Old Url would be the one that you set up in ‘Settings’.
To get into the database, your host probably has some utility such as PHPMyAdmin. And then once you’ve edited the query with your urls, then run it on the database.
Good luck.
(As for the domain name issue, if the new domain name is pointed to your root folder, then your ‘move’ should have theoretically worked. So I’m guessing that the new domain is not completely active or perhaps it isn’t pointed to the same folder as the current website? Is it an addon domain in another folder?)
Oh, this is probably whats wrong. I forgot to change the domain on the hosting. Hopefully that’s it. Thanks again!
No prob! I know how frustrating it can be to move a blog.
Well your original solution (Method 1) for moving to a new domain seems to have worked flawlessly. The wordpress plugin made things a lot easier. I just forgot to change the hosting-domain link. Cheers!
I would like to change the URL of my blog from example.com/a to example.com/b. In other words, I just want to change the URL of the blog while staying at the same domain. I have not yet made any location changes, and I am just exploring my options at this point. I have the ability to change the physical WordPress directory if I wish to do so. But “Option 3: Only Change URL” sounds so easy that it makes me wonder why anybody would want to use “Option 1: Move Files” or “Option 2: WordPress Import/Export”. But maybe I don’t comletely understand this whole matter. Is there any disadvantage at all in using Option 3? If there is no disadvantage, why would anybody want to use Option 1 or Option 2, which sound much more difficult than Option 3? By the way, I am using WordPress version 2.6.3.
Hi Ghmkcatyo. If you want to change the directory of your blog, you can simply update the settings and then rename its folder. (No moving of files required.) And then our plugin would update all urls in permalinks (for images) and in content links.
For more information on Giving WordPress its Own Directory, take a look at this article in the WP Codex: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
Hi Velvet Blues,
Thank you very much for your prompt reply.
It would be perfectly OK if I lose all of my content when doing the migration. That’s because it is a new blog that has not yet gone live, and it only contains a few test posts that I will delete anyway before it goes live. However, I have spent a few hours customizing the blog’s templates, and I do not want to lose those customized templates. By the way, I have not added any images to the blog.
Please answer the following questions from my original post:
Is there any disadvantage at all in using Option 3? If there is no disadvantage, why would anybody want to use Option 1 or Option 2, which sound much more difficult than Option 3?
By the way, I was kind of surprised to see you talk about a plugin in your reply. I had the impression (from reading your main article) that Option 3 does not require a plugin (which is one of the reasons that Option 3 sounds much easier than Option 1 or Option 2).
hi,
I updated the ‘WordPress address’ and ‘Blog address’ to a unexisting url. So, now i can´t open the wp-admin… anybody knows how to update to the old settings????? really thanks…
@albert, the only way that I’ve used to get out of this situation is to go into the database and update the settings. This can be done manually in phpmyadmin or by running an SQL query… Are you familiar with working with your database?
@albert, Here is an easy solution: http://codex.wordpress.org/Changing_The_Site_URL
not at all… i think i can update it… but i don´t know the file that i have to update. i don´t a backup of this database… can i do anything?
thank you very much for your immediate response, I’m desperate!
The file that they are referring to in the above documentation that I linked to is the ‘functions.php’ file. It is located in your theme directory… Do you have access to FTP? If so, navigate to:
wp-content -> themes -> your theme name -> functions.php should be in this folder.
yes, i have acces to ftp and I updated this file, and all is the same…
The problem is that when I do the login it redirect towards to the url that I putted in “WordPress Address and Blog Address”.
Hmm. That’s strange. That should work… Well then, the only last option that I can suggest is that you update your database. Perhaps you have access to ‘PHPMyAdmin’ or some other database editing utility?
You can manually search and edit values in the table, or you can run an SQL statement:
UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’) WHERE option_name = ‘home’ OR option_name = ’siteurl’;
This site shows the process of working with PHPMyAdmin. (It’s probably an older version that you have, but the process is still the same.)
I am trying the second option of http: //codex.wordpress.org/Changing_The_Site_URL but it says:
update_option(’siteurl’,'http://skibar.gpscerdanya.info/blog’); update_option(’home’,’skibar.gpscerdanya.info/blog’);
Warning: Cannot modify header information - headers already sent by (output started at /nfs/c03/h02/mnt/52232/domains/skibar.gpscerdanya.info/html/wp-content/themes/design_showcase/functions.php:2) in /nfs/c03/h02/mnt/52232/domains/skibar.gpscerdanya.info/html/wp-includes/pluggable.php on line 850
I keep trying with option 3….
i´m working with 2.7 in a new blog, i going to try to manually search and edit values in the table. maybe… it´s not the best place to writte it?
It’s PHP Code…. Did you put it within the php tags?
It looks like it outputted it directly, so you might not have…
It should be after the <?php tag… on the next line.
blog is not working… but i will fixed it. Now i´m sure. A lot of Thanks!
Great! And no problem.
Hi Velvet Blues,
Please respond to post #13.
Thank you very much.
Hi Ghmkcatyo, If you don’t mind losing your test posts, then you don’t need to worry about a ‘real’ move. All you need to do is copy your current themes directory. And then after you create a new install in some other location, then upload the themes directory, overwriting the default directory. (And Option 1 & 2 accomplish the same end result. Option 3 means that your blog location is a different location than the files… However you will need to move the index.php file to the new directory.)
As someone who has just started ‘flipping/selling’ blogs and wishing to offer to transfer a blog from my Reseller account to a buyer’s own hosting account as part of the sale this is great info.
But, as I hope to be doing this a lot, can you recommend where I might go to find somebody to do this for me for cash - or do you know someone? i.e. Outsource, as while I love blog design etc. I am embarrassed to admit to being phobic about all of the above
Clive’s last blog post..2009? Call Me Flipper!
@Clive, thanks for stopping by. I don’t know anyone out there that does this, but we do offer this service starting at $50. ($50 for small/normal sized blogs, and up to $100, depending on number of images, and amount of data.)
Otherwise, you can always try Craigslist.
Thanks for a nice plugin, that i am sure i will be using a lot in the future! I have just tried it for the first time, but i am unsure of what excactly to put in the fields. I am moving a site from http://www.digitaludskrab.eu/actionplay to http://actionplay.dk
Can you tell me excactly what i need to put in when filling out the two fields of the plugin in this specific case?
Thanks in advance
@Esben: Sure.
In the ‘Old Url’, put the first url.
In the ‘New Url’, put the second.
Enter the urls exactly as you’ve entered them here.
@VB:
Perfect, thanks for a quick response!
Hi there. Just to confirm, for Method 1: Use WordPress’ Built-In Import, this needs to be done once the propagating is complete, right?
Thanks!
Hilary
I’ve been trying and trying to move my word press blog to a new domain and host. All I keep getting is creat a configuration file, but should I do that since I’m not creating a new word press, just moving an old one?
My existing blog is running WP 2.1. I am trying to move it to a new domain. I installed WP 2.7 on the new domain and it is running fine unpopulated. I then followed method 2 above. New blog stopped working. Do I need to upgrade existing blog to 2.7 first and then move to new domain.
I’m hoping you can help me, or point me in the right direction to get help. I’m new to all this and very confused. Tried finding help on the net but not finding anything that has helped so far.
Without going into a book on the details, this is a brief outline of my situation.
2 domains. abc.com and xyz.com. I want wp to be xyz.com/blog
abc.com is main domain and xyz.com is inside a folder of abc.com i.e. abc.com/xyz.com. xyz.com is classed as a pointer domain.
There was a problem trying to install wp so the web host support staff got involved. Only one person was able to help, up to a certain point, and then I was left with what they did.
What left with:
In abc.com web directory
folder for xyzwp
folder for xyz
plus all the web “stuff” for abc.com
In xyz folder
folder for xyzwp
plus all the web “stuff” for xyz.com
The xyzwp folder inside abc is the one the web host support person was able to generate a password for me, and is the wp which should be used.
I should mention that trying to delete the xyzwp folder within xyz folder can’t be done by me. Don’t know if the support staff tried to delete it or not.
When logged into wp under General the Wordpress address URL shows as abc/xyzwp and the Blog address is identical. I haven’t changed anything yet.
Question: will this setup be able to show the blog address as xyz.com/blog or if not how do I fix it?
Sorry for the long outline, but that is as brief an outline as I can give.
Your plugin rocks… I searched for info on how to move to a different directory.. your step by step was the best and your plugin made it even easier.. thanks!
although wordpress notified me that the plug in was not tested with 2.7.1 - it worked great!
my wordpress folder got deleted by accident. My host, Godaddy, had me build a new mysql file and they restored the old database into that new file. I did the restore of the wordpress folder so my uploaded files are present, but when I reconfigured the wp-config.php to the new identity so they see each other the blog comes back essentially empty, none of my old posts, pages, comments etc. are present.
I see that none of my widgets are in place, it’s as if the theme was reset to default. Also, all my plug ins are in the plug ins folder but none are activated nor applied.Wouldn’t my customized theme have come back with the restore of the Wordpress folder? Or is there some pointer to the mysql that WP is not seeing right? The new mysql has a different user name and database name than the old, but I updated wp-config.php to see the new mysql.
Is there some other file that needs to be updated with those new names so the theme i customized comes back?
Google has them cached for now, can I get the code from Google and plug the pages back in somehow? If so how?
Thanks in advance.
Sam