Web Design and Development
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.
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 web 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.
blogs, content management system, WordPress