Easily move WordPress site to new server
It's easy to move a WordPress site from WordPress.com to a self hosted WordPress install. Or migrate WordPress from one server to another using these simple steps.
Move WordPress site from WordPress.com to self hosted
Using WordPress.com you can export your pages, posts, comments, categories, and tags. Then import this content into a self hosted WordPress install, just worrying about you plugins, themes, or widgets from that point.
Export your WordPress site from WordPress.com
If you already have a site on WordPress.com just follow these steps to export your data:
Log in to your WordPress.com dashboard
In my example this is: http://JacobIMH.wordpress.com/wp-admin
- Hover over Tools, then click on Export
- Under Export Option, click on Export
- Under Choose what to export, leave All content selected and click on Download Export File
- Take note where you download the jacobimh.wordpress.YYYY-MM-DD.xml file to
Create blank WordPress site to import data into
Now that you have your WordPress site data exported to your local computer, you'll need a fresh WordPress install on your server to import that data into.
- Either install WordPress with Softaculous, or install WordPress manually
- Then login to your WordPress dashboard
- Hover over Tools, then click Import
- Now click on the last option for WordPress
- On the WordPress Importer screen that pops up, click on Install Now
- Next click on Activate Plugin & Run Importer
- Click on the Choose File button, select the WordPress export you created, then click on Open
- Now click on Upload file and import
Under the Import author either type in a new user name you'd like to assign the imported posts to, or beside or assign posts to an existing user click on Select and choose an existing user
Also under Import Attachments select Download and import file attachments, then click Submit
Finished with WordPress.com migration
You should now have successfully moved your WordPress.com site to its own self hosted WordPress install!
Now you just might want to login to your WordPress dashboard and start adding any Plugins, Themes, or Widgets that you had been using on WordPress.com.
Move WordPress to a new server
If you already have WordPress installed on a server, and would just like to move it to another server this can be accomplished easily as well.
The benefit of doing a full WordPress migration from one server to another is that it brings over everything you've done in WordPress up to this point, including Plugins, Themes, and Widgets.
Download WordPress site content from old server
When migrating a WordPress site to a new server, first save all of the current content from the previous server:
- Using FTP, connect to your WordPress site on your old server
Download all files in your document root directory, typically /public_html to your local computer
Install WordPress to a folder like /wordpress? Just download that folder instead.
Download WordPress database backup
With the WordPress files saved to your computer, next you need a copy of your WordPress database:
- You want to export your WordPress database with phpMyAdmin
Create MySQL database on new server for WordPress
Since you've got the WordPress database backed up, the next step is creating a new database to import that into.
Create a MySQL database on the new server
Take note of the Database name, Database user, and Database password you've set
In this example here is what I wrote down:
Database name: example_wrdp1
Database user: example_wrdp1
Database pass: myDBpassword
Modify downloaded wp-config.php file with new database
Before uploading your WordPress files to the new server, you need to adjust your wp-config.php file with the new settings.
- From the WordPress files you downloaded, open up the wp-config.php file with a text editor
- You will want to modify the highlighted code with the new server's database info you took note of:
/** The name of the database for WordPress */ define('DB_NAME', 'userna5_wp12'); /** MySQL database username */ define('DB_USER', 'userna5_wp12'); /** MySQL database password */ define('DB_PASSWORD', 'FGdgA%#5'); /** MySQL hostname */ define('DB_HOST', 'mysql.example.com');
So for our example we end up with:
/** The name of the database for WordPress */ define('DB_NAME', 'example_wrdp1'); /** MySQL database username */ define('DB_USER', 'example_wrdp1'); /** MySQL database password */ define('DB_PASSWORD', 'myDBpassword'); /** MySQL hostname */ define('DB_HOST', 'localhost');
It's important to point out that the DB_HOST might have been a hostname previously on your old server. Typically if you're migrating WordPress to a server where they MySQL server and website are on the same server, you can just use localhost to let WordPress know to look locally for the database.
Upload WordPress files to new server
Now that your wp-config.php file is adjusted for the new server, upload all your files there.
Using FTP upload your downloaded WordPress files to the new server
If you've installed WordPress to a folder like /wordpress, make sure to upload the files there.
Import WordPress database backup to new server
The last step in a WordPress migration to a new server is importing the WordPress database backup to the server
Finished moving WordPress to new server
You should now have successfully migrated your WordPress site from one server to another!
You might want to login to your WordPress dashboard to ensure everything is working now on the new server.
Support Center Login
Social Media Login
2015-01-04 2:42 pm
Great video and article. I have an additional question. By mistake I installed all of the wordpress files in the document root of hcp-consulting.org
I would like to move it now to a sub directory in the root. Does this work exactly the same way? How does it work it if it is in the root in a directory called "hcp" - how do I make it that site visitors can access it by going to hcp/consulting.org instead of hcp-consulting.org/hcp ?
Thanks for your help and the great instruction you posted
2015-01-05 12:40 pm
Thanks for the comments! Moving a WordPress location isn't really all that difficult, but you should definitely take care in making the move. Our tutorial on Moving WordPress will give a good reference point and the steps needed for the move. You can also find a complete article on moving WordPress from one location to another here.
In answer to your last question, the steps for that process are provided by WordPress in their documentation: Giving WordPress its own directory.
I hope this helps to answer your question, please let us know if you require any further assistance.
2015-04-28 1:51 pm
Thanks for the video. Great tempo and clarity! Made the process much less daunting that all the writeups I've seen. Couple of questions:
I've read in several places that as a last step before exporting the database and exporting the WP files, you can change the Wordpress URL and Site URL in Settings > General to the new domain and save. Is that even possible? You obviously won't have access to the old site any more via the domain, but this in theory would eliminate having to make the URL changes in the new database tables, correct? Also, if I use the same database, name/user/password combination on the new server database, the only thing I would need to change in the wp-config.php file would be the dbHost, correct?
2015-04-28 2:29 pm
If I followed what you were saying correctly that is how it should work. It is a relatively simple process anyway so if a couple of places need to be revisited that is also fairly easy to adjust.
2015-08-28 1:19 pm
Hi, thanks for that great tutorial, i have a question.
Do you know if exist some tool (paid or free) that makes this migration completely automatically?
Because if i have a couple sites this is ok, but if i have 30 or 40 websites consume lot of time.Thanks.
2015-08-31 2:00 am
Unfortunately we are not aware of a tool that exist to completely migrate the WordPress website. However that is a great idea for a future plugin.
2016-04-28 2:33 pm
First, this was an excellent tutorial. Worked perfectly. I'm going to use this sequence for my web design business, pulling a client's site over to a dev server, doing my work, and then sending it back to the client's server.
My question: Once I'm done working the client's site, what process do I follow to migrate it back to their server and replace their old site? This exact process but in reverse?
2016-04-28 4:25 pm
Thank you for contacting us. Yes, you would use the same process to migrate the files back to the older server/site.