Changing The Current Site’s URLs
As of WP Migrate DB Pro 1.7, in-place find and replace functionality is included as part of the plugin. This can be used to update a site’s URL rather than the steps below.
The main purpose of WP Migrate DB Pro is to migrate a site’s database from one location to another. However, sometimes you just want to change the URLs in the current site’s database. For example, you may want to just make your staging server the production server without setting up a new site:
- A staging site is set up at http://staging.example.com
- You complete the work on the staging site and decide you want to make it the new production site
- The URLs in staging site must now be updated from http://staging.example.com to http://example.com
- The relevant DNS records are updated to point example.com to the new production site location
Below are the steps required to complete #3 from above:
- Backup your database
- Log into the staging site
- Navigate to WP Migrate DB Pro plugin page (Tools → Migrate DB Pro)
- Select the “Export File” radio button from the list of migration options
- In the “New URL” field, enter the protocol-free URL of the new production site, e.g. //example.com
- Remove the “New file path” find & replace row, hover over the row and click the “X” icon
- If your database contains tables that do not use WordPress’ table prefix (usually wp_) you’ll need to select the “Migrate only selected tables below” option under “Tables” and click the “Select All” text link
- Click the “Migrate DB” button
- A MySQL dump file will be generated. A prompt will allow you to save the dump file to your computer
- Import the MySQL dump into your database via phpMyAdmin or command line