Move WordPress Site

June 4, 2013 3:33 pm

We would like to share our solution and show you how to move WordPress site from local installations to the live servers (and vice versa). We are using this solution for making all our HotStart installations (WordPress theme installations packed with demo data).

Move WordPress site

This solution works for all WordPress versions since WordPress 3.4 and the last version we tested was WordPress 3.5.1. This tutorial can be also used when you move the WordPress site from any location to any location (another host, another folder, subfolder, etc.).

There are several simple steps to move WordPress site to the live server while keeping all settings and data previously created through WordPress. In order to achieve that, you would need to have PhpMyAdmin in the source location. We believe everybody who works locally has this handy tool. It comes as a part of all popular solutions for local development, such as XAMPP for Windows and MAMP for Mac. It’s also included by almost all hosting companies as a part of all hosting packages.

Steps required to move WordPress site and keep all data

Let’s explain how to move WordPress site now! What you can expect when the procedure is completed is an exact copy of your local WordPress site (source) on the live (target) server.

  1. There are two modified WordPress files (install.php and setup-config.php) that you can download from here. Extract archive. Copy both files to your source WordPress folder /wp-admin (overwrite originals).
  2. Open PhpMyAdmin on your local (source) server. In the left column, click your local (source) WordPress database name. Then click the Export tab. For Export Method, select Custom. Click Select All to select all database tables. Under Object creation options, tick Add DROP TABLE. Under Data creation options, part “Syntax to use when inserting data”, select the first option: “Include column names in every INSERT statement”. Check if everything is as on our screenshot. You can click the GO button finally. Name the SQL file as hot_start.sql and save it to your source WordPress folder /wp-admin.
  3. Open hot_start.sql in your favorite plain text editor. You should replace all instances of local (source) URLs of your WordPress, in an example, http://localhost:8888/your_wordpress to this (use find/replace the function of your text editor).
  4. ZIP up your entire WordPress installation now, excluding file wp-config.php. Make sure you packed all files and folders. Make sure you didn’t add file wp-config.php to the archive. Upload archive and unpack it on your server. If you can’t unpack archive directly on the server, you can upload all files (excluding wp-config.php) via FTP.
  5. Enter your live (target) server URL in any browser. If everything is uploaded properly, you should see the initial screen of the WordPress installation. Make sure you have one empty MySQL database on your server before continuing.
  6. When asked during the WordPress installation process, you should enter the correct database connection parameters. This is what you usually do when installing a clean WordPress. In this modified installation, it’s not possible to change the database prefix parameter.
  7. During installation, it’s not possible to change the site title and administrator’s credentials. However, you can edit all these parameters later through WordPress.
  8. After installation, you would get an exact copy of your source site. WordPress administrator’s user/pass will be admin/admin. Make sure you change it immediately after the first login to the WordPress dashboard.

All steps of this tutorial are straightforward. However, you should be extra careful when you are exporting the database on your local (source) server using the PhpMyAdmin tool (in step 2). Therefore, we will attach a screenshot will correct settings of this export process. Make sure it matches your settings when you are exporting your database.

move wordpress site

Common mistakes when you move WordPress site

  1. You forgot to change original install.php and setup-config.php files with files from Step 1.
  2. Source database exported improperly. Check the screenshot again.
  3. MySQL export file is not named as hot_start.sql and/or is not copied in /wp-admin folder.
  4. File hot_start.sql not edited properly. All source server’s URLs are not changed with as described in step 3. As a result, a new WordPress installation (target) links are leading to the old installation (source). In this case, you should try to move WordPress site again. Delete all files and database and start all over again.