This solution works for all WordPress versions since WordPress 3.4 and the last version we tested it was WordPress 3.5.1. This tutorial can be also used when you move 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 work locally have 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.
- There are two modified WordPress files (install.php and setup-config.php) that you can download from here. Extract move_wp_site.zip archive. Copy both files to your source WordPress folder /wp-admin (overwrite originals).
- 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 screen shot. You can click GO button finally. Name the SQL file as hot_start.sql and save it to your source WordPress folder /wp-admin.
- Open hot_start.sql in your favorite plain text editor. You should replace all instances of local (source) URLS of your WordPress, in example, http://localhost:8888/your_wordpress to this http://hot-themes.com (use find/replace function of your text editor).
- ZIP up your entire WordPress installation now, excluding file wp-config.php. Make sure you packed all files and filders. 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.
- 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.
- When asked during the WordPress installation process, you should enter 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 database prefix parameter.
- During installation, it’s not possible to change site title and administrator’s credentials. However, you can edit all these parameters later through WordPress.
- 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 first login to WordPress dashboard.
All steps of this tutorial are straightforward. However, you should be extra careful when you are exporting database on your local (source) server using PhpMyAdmin tool (in step 2). Therefore, we will attach a screen shot will correct settings of this export process. Make sure it matches your settings when you are exporting your database.
Common mistakes when you move WordPress site
- You forgot to change original install.php and setup-config.php files with files from Step 1.
- Source database exported improperly. Check the screen shot again.
- MySQL export file is not named as hot_start.sql and/or is not copied in /wp-admin folder.
- File hot_start.sql not edited properly. All source server’s URLS are not changed with http://hot-themes.com as described in step 3. As a result, 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.