How to Migrate WordPress

wordpress migrate

Migrating WordPress from one host to another doesn’t have to be an incredibly difficult task. Even those with little-to-no online programming knowledge may be able to transfer their data and files safely. All it really takes is a bit of patience and time to follow instructions. In this tutorial, you’ll learn how you can migrate your entire site without causing errors or losing important information.

There are three primary ways people would want to migrate their WordPress websites: host-to-host, WordPress.com-to-host or exporting specific data to use elsewhere. Decide which one better fits your specific goals.

Moving From One Host to Another

Perhaps you found a hosting company that is better suited for your needs. Maybe you want to consolidate your sites into one unlimited hosting account. Regardless of your needs, moving your WordPress site from one host to another can be easy – if not time consuming. For the most part, the experience may rely more on what tools you use for the transfer.

Moving WordPress Files

moving wordpress files

When you transfer WordPress files, you need to make sure you’re capable of accessing your root folder. This is often done with the aid of an FTP, or File Transfer Protocol, application. These are pieces of software that allow you to connect to your host and download all of the files related to your website. There are many free applications available for download to help you retrieve these files such as FileZilla and CuteFTP. Others will use professional programs such as Dreamweaver or even Visual Studio.

Using cPanel

If your current host is using the cPanel account management application, the File Manager tool is capable of downloading the entire site in a single .ZIP file. This could save a lot of time and reduce the risk of file corruption should something happen to your Internet connection when retrieving multiple files. You see, any given WordPress website could have hundreds upon hundreds of files at any given time.

FTP Credentials

In order to retrieve the files to transfer WordPress, you’ll need to know the FTP server login and password. This can be obtained by contacting your hosting provider. In cPanel, that information is in the “FTP Accounts” tool under the section for “Files.”

Uploading Your Files

After downloading all of your files, you’ll use the FTP application to upload them to the new website host. You’ll need the FTP credentials from the new host in order to connect to the root folder for this upload. Once this is done, your files will now be present and ready for your data.

Moving the Database

moving the database

The database is where most of the important information regarding your website is held. This needs to be exported from your current host and imported to your new one. This can be done in different ways, and it will be dependent on your current host of how you can export the database.

Databases in cPanel

If your current host uses cPanel, you can export the MySQL database by using a tool called “phpMyAdmin.” This tool allows you to find the database related to your WordPress site and export those files. Essentially, you’ll create a backup of the information to be used as an import to your new host.

Creating the Database Before Importing

Before you can import the data to the new host, you’ll need to create a database. This is easy to do if your new host has cPanel or gives you access to the “MySQL Databases” tool. If not, you’ll need to have the host’s support staff help you create a new database for WordPress to access. You’ll want to keep track of the information you use to create this database as it will be used by WordPress in order to pull the correct information. The next part goes into how this is done.

Configuring WordPress

Your website isn’t going to work properly until it’s able to pull information from the new server. In order to do this, you’ll need to modify the code a bit. Don’t worry, it’s not an excessively difficult process.

  1. Find the wp-config.php file in your WordPress root folder
  2. Using an editor, find and modify the following:define(‘DB_NAME’, ‘user_wrdp1’);

    /** MySQL database username */

    define(‘DB_USER’, ‘user_wrdp1’);

    /** MySQL database password */

    define(‘DB_PASSWORD’, ‘password’);

You’ll need to replace the values of username and password displayed above as “*” for your new database. Once the file is saved with these two changes, WordPress will begin pulling data from the new host.

Moving From WordPress.com to a New Host

moving wordpress to a new host

WordPress.com is great for hosting free sites, but it’s limited in what you can accomplish. People will often move their site from this service to their own stand-alone hosting providers in order to have more functionality and greater control of the site. To do this, you will:

  1. Go to the Tools area of your WordPress.com dashboard and select export.
  2. Making sure the radio button for “All content” is selected, click on “Download Export File.” You will then download the .XML file of your data and information from WordPress.com. For now, it may be easier to keep this file on the desktop of your computer for quick recovery later.
  3. Go to your stand-alone host installation of WordPress.
  4. From this dashboard, go to your “Tools” menu and select “Import.”
  5. WordPress has a variety of places it can import from. Scroll to “WordPress” at the bottom and select it as your import type.
  6. If the WordPress Importer plugin is not detected, a popup window will be displayed asking you to install it. Click the “Install” button for this plugin.
  7. Once the plugin has been installed, you’ll need to click the available link for “Activate Plugin and Run Importer.”
  8. You’ll be redirected back to “Tools” where you will find a field to browse for the .XML file you downloaded from WordPress.com. Search for this file by clicking the “Browse” button and select it.
  9. Click the “Upload file and import” button below the text field.
  10. Before you can continue, WordPress will ask about assigning authors to the posts. You can leave this as the default, “admin” if you wish. However, you can assign a new user name to the content.
  11. The “Download and import file attachments” box should be checked if you want to keep your images and other attachments.
  12. Click the “Submit” button on the bottom left and your data will be moved from WordPress.com to your new website host.

Exporting Specific Pieces of Data

Moving the entire site is only part of what migrating WordPress data can involve. Perhaps you want to move the pages and posts from one site to another without keeping various other aspects of the site. This can be helpful when you’re redesigning the site from scratch and only want to keep the content. This aspect to transfer WordPress information from one site to another is relatively quick and easy.

Note: It’s important to clarify that only the content and images can be transferred in this manner. Plugins, themes and other configuration files will not be exported using this method.

  1. Go to the “Tools” section of your WordPress dashboard.
  2. Click on “Export.” From here, you’re capable of choosing which files you want. For example: you can chose posts, pages or all content depending on what you want to export.
  3. Once you select the corresponding radio button, click on the “Download Export File.” button. You will then download the .XML file you’ll need later.
  4. Go to your new WordPress website and select the “tools” located in the dashboard.
  5. Click “Import.” In the list that is displayed, select “WordPress” located at the bottom. Like before, this requires the “WordPress Importer” plugin and you may be prompted to install.
  6. After the installation and activation of the plugin, you’ll be directed to the import page for WordPress.
  7. Browse for your previously downloaded .XML file and click the “Upload file and import” button.
  8. From here, you can select a new author or leave the default as is. Make sure your “Download and import file attachments” box is checked and click, “Submit.”

Although it may be advisable to have an expert migrate your WordPress installation for you, it may be some comfort to know that you’re capable of doing this yourself without having extensive programming knowledge. While some aspects of migration can be quite time consuming, especially if you have a large website, many of these steps are easy to implement.