Step 1: Make a Local Copy of the Existing WordPress Site Files
The first thing to do is connect to the FTP server which provides access to the files for the existing WordPress installation. Getting an entire site is time consuming and, with any decent FTP client, it’s automated, so I make this step one. Just connect via FTP and sync a directory on your local disk to the document root which contains your live WordPress install. Now, with files, we can move on to other steps.
Step 2: Get a Dump of Your Current WordPress Database
The easiest tool to use here is going to be PHPmyadmin All hosting providers offer this service to their users. Follow these steps to get your existing database exported:
- Connect to the instance of phpMyAdmin which provides access to the database for your current site. Enter your credentials to log in to the management interface.
- Select the database for your existing WordPress installation from the list on the left. (in this case my present database name is “craniumstorm”)
Click ‘Export’ at the top of the window
Ensure that the radio button for the ‘Quick’ export method is selected. Click the ‘Go’ button to download a .sql file containing a dump of your current database table structure along with all of your existing data.
Step 3: Change database name and new domain name
Make a copy of downloaded database file and Open the sql file in a text editor like notepad
- Find the old database name and replace it with your new database name.
- Find your old domain name and replace it with your new domain name.
Save the file.
Step 4: Import Your Database
Now you have to reverse the export process to populate your new database.
- Log in to the phpMyAdmin interface for the new database.
- Select the new database from the list on the left (see Fig. 1, above).
- This time, click the ‘Import’ tab at the top of the window.
- Now you’ll have to select the file you just downloaded containing your database dump so that you can upload it here. Click the ‘Choose File’ button and locate the .sql file which you have edited with new details.
All that’s left for this step is to click the ‘Go’ button to import your data.
Login to your admin panel with your old server Privileges and check is everything is ok.
Step 5: Upload the WordPress Site and Edit Your Configuration
Uploading the entire WordPress site is the next logical step here.
- When you’re ready, connect to the FTP host for the new site.
- Upload the entire contents of the site to its new home.
- Edit your /wp-config.php file to include the correct information for your new database:
- // ** MySQL settings – You can get this info from your web host ** //
- /** The name of the database for WordPress */
- define(‘DB_NAME’, ‘databasename’);
- /** MySQL database username */
- define(‘DB_USER’, ‘username’);
- /** MySQL database password */
- define(‘DB_PASSWORD’, ‘somePass’);
- /** MySQL hostname */
- define(‘DB_HOST’, ‘localhost’);
This has come up a couple of times now, so I’m going to say here in advance that you should try logging into the admin panel in the new location at this point. If you get in without any problems, go to Settings > Permalinks and click ‘Update Permalinks’ to make sure WordPress updates the .htaccess file.