Easily move a WordPress site from WordPress.com to a self-hosted WordPress install or migrate your WordPress site 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 your 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 dashboardIn my example this is: https://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 userAlso 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 serverTake note of the Database name, Database user, and Database password you’ve setIn this example here is what I wrote down:Database name: example_wrdp1Database 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.