Support

 
You must be logged in to post
Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

How to move a WordPress site from one host to another

Post

marc

posts 179

10:27 am September 26, 2011

1

Post edited 5:34 pm – February 13, 2012 by marc


1) How to move a self-hosted WordPress site from one host to another on the same domain – easy way

Easiest way to move a site is to use the migration services provided by the hosting company (in our case, Hostgator). We need to make a request, wait for completion, and then you change the name servers of your domain to those required by the new hosting account (in the case of WordPress Academy hosting, the name servers are ns1 and ns2.wpwebsitenow.com).  

This works for moving static html sites also.  If you are replacing a static html with with a WordPress site, but you need your current html site to be active during the time you are developing the new site, see here.

 

2) How to move a self-hosted WordPress site from one host to another on the same domain – do-it-yourself method (using sub-domains and WPClone)

This is a method for do-it-yourselfers that is not too complicated and allows both sites to be active during the transitions.

Assume that yourprimarydomain.com is already hosted on your new (destination) host, and that youroldsite.com is hosted on another server and you want to move it to your new host but under the same domain name.

  1. Setup a sub-domain youroldsite.yourprimarydomain.com and install wordpress on it. This process is described here
  2. Use WP Clone or similar plugin such as Backup Creator to move the site from youroldsite.com to youroldsite.yourprimarydomain.com
  3. Create an add-on domain (on your new hosting) for youroldsite.com and point it to the same sub-directory as the sub-domain
  4. Change name servers for youroldsite.com and wait for name server propagation.  You will know it's done when you see the internal links on the site (navigation bar links) will refer to to  youroldsite.yourprimarydomain.com.  This means it is now accessing youroldsite.com on the new hosting.
  5. Login to youroldsite.yourprimarydomain.com/wp-admin and set the "Settings > Blog url" and "Site url" to http://youroldsite.com.  Then check the site, you will see internal links updated.  You will need to login again at http://youroldsite.com/wp-admin 
  6. Add plugin "Velvet Blues Change Url" and do a search and replace throughout your entire site, replacing http://youroldsite.yourprimarydomain.com with http://youroldsite.com

3) How to move a self-hosted WordPress site to another domain?

In that case the process is even easier — just create the new add-on domain on the new server, set name servers for the new hosting, install WordPress on it and use WP Clone or Backup Creator as above

4) How to move a WordPress.com hosted site to self-hosted site

This involves a combination of the methods above.

Assume you have a site at http://youroldsite.com (hosted on WordPress.com) and a new hosting account under primary domain http://yourprimarydomain.com. This is what you do:

  1. Create a new WordPress installation on http://yourprimarydomain.com (this may be a temporary domain)
  2. On your old (Wordpress.com) site, use the Tools > Export function to create an export file. Then on the new site, use the WordPress Tools > Import to import all posts, pages and links.  You will need to manually install a new theme and configure your sidebar widgets etc. manually.  When you are done, your http://yourprimarydomain.com should look similar or identical to your old site
  3. Park the old domain youroldsite.com on top of your current primary hosting domain (in cPanel see Domains > Park domain), change your name servers and wait for name server propagation.  You will now see your new site at http://youroldsite.com
  4. Follow the instructions above to change Site Url, Blog Url, and run Velvet Blues url changer.

When complete you will have a self-hosted WordPress site at  http://youroldsite.com (and you can drop yourprimarydomain.com if you want, or let it expire, and only use youroldsite.com)

5) Moving a WordPress site — manual method for techies

Sometimes the manual method is the most expedient. This method works in all cases — same domain or different domain, sub-domain to primary domain, sub-directory to primary domain etc. 

It's easier if your destination site already contains a blank WordPress installation.  Proceed as follows:

  1. Use FTP to copy the entire /wp-contents directory from the old site to the new site.  You won't normally need to copy any of the WordPress installation files, but if you do, you should specifically omit the file /wp-config.php as that file has your database connection information in it — you do not want to overwrite it.
  2. Make a database backup of your old site using WP-DB-BACKUP plugin and save the backup to your local computer
  3. Extract the .sql file from the .gz backup file (any good decompressor will do this), open the file in a text editor that understands Unix newlines (such as Notepad++, the regular notepad won't work).  Do a global search-and-replace from "http://youroldsite.com" to "http://yournewsite.com".  (You can omit this step if newsite and oldsite are the same, ie. you are moving site as-is from one host to another).  Save the .sql file
  4. In FTP, view your newsite's /wp-config.php and find the database name.  You will see a line that says something like:
    define('DB_NAME', 'wp1');
    In this case the database name is "wp1"
  5. In your hosting control panel, open up PHPMyAdmin.  You should choose your database on the left panel.  Then use the "Import" function (at the top), and import the patched .sql file you made in step 3.  If all goes well you will get a Success message.  All previous data in the database will be lost, so be sure you are operating on the correct database
  6.  If you are moving from one host to another on the same domain, you can now change name servers and wait for name server propagation.  You will know it's done when you access your new cpanel at http://yourprimardomain.com 
  7. You should now see your site at http://yournewsite.com.  You won't need to update the Blog URL and Site URL, as this should already have been done in Step 3.
No Tags


About the WP Academy Forum

Forum Timezone: America/New_York