At some point, every developer is faced with a challenge of moving WordPress installation from one server (or localhost) to another server. There are many different situations, which require migration. Among them are:

  • You were developing site locally and want to move it to production
  • You want to move (or make a copy) of the site to another domain name
  • You want to switch your hosting provider (yes Godaddy, I am looking at you)
  • You want to upgrade from shared to VPS hosting

Let me first explain the basic. You probably already know them, but some readers might not. Click on the following link, if you want to skip it and move on to the solution.

WordPress installation consists of files, among which are core files, uploads (images), theme(s) and plugins and it consists of MySQL database, where all the content is stored. When moving WordPress to a new host, we need to copy all of the above. Besides that, we also need to set the wp-config.php file.

There are, of course, many ways, how to migrate your WordPress. Some prefer using plugins and others want to do it without leaving the terminal window. I will walk you through the plain old-school procedure, that I find easiest and fastest. This is the exact way, I migrated a couple of hundreds WordPress installations during my career.

Things I assume you have on both servers:

  • FTP access
  • MySQL access

FTP access allows you to copy files from and to the server. There are many different a FTP clients you can choose from, like Transmit (OSX), WinSCP (Windows), Filezilla or Cyberduck.

MySQL credentials are written in WordPress config file wp-config.php, which resides in the root folder of your WordPress installation. Open it in your favourite text editor and voila, here it is, under DB_NAME is the name of the database, DB_USER is the user, which has the access to the database and DB_PASSWORD is your MySQL password.

PHPMyAdmin is your friend. With it, you can import and export the database. PHPMyAdmin is an open source software and is usually already available on the server. If it is not, you can simply download it from and place it on your server. Then you can log in with the MySQL credentials.

The solution

On the old location

  1. Download all the WordPress files using your FTP client. To save some time, compress them, before download.
  2. Within PHPMyAdmin navigate to the WordPress database and export it.

Now you have all the files and the database ready for migration.

On the new location

If you need to set your domain name on the server, now is the time. If the domain is new, you will also need to configure DNS settings for this domain. After you are done with it:

  1. Copy the WordPress files to the server (with a FTP client)
  2. Create a new database on your new server, assign the database user to it. Copy MySQL credentials somewhere (text editor), as you will need them later.
  3. Open PHPMyAdmin and import the database file from the old location.
  4. You have the database and the files ready and you’re almost done. Open the wp-config.php file with your text editor.
    Paste your new database credentials (DB_NAME, DB_USER, DB_PASSWORD). If the domain name has changed, you should also add the following settings to the wp-config.php:
    (Make sure you change with your new domain)

This is it. Now if you visit your site in the browser, it should already work. But there is just one last thing more you should do. Login to your site (login credentials are the same as on the old site), go to Settings -> permalinks and just resave. This will modify your .htaccess file if needed.