-
Notifications
You must be signed in to change notification settings - Fork 858
Use Search Replace DB to migrate Wordpress content to a Fresh install
danelige edited this page Feb 19, 2017
·
1 revision
Starting point: https://www.smashingmagazine.com/2013/04/moving-wordpress-website/
Search Replace DB explanations need more details:
- When migrating Wordpress to a new host, create a new cPanel with the new host.
- The domain of that cPanel will be temporary (usually: servername/~cPanel username. for example http://xxxx.server.com/~mynewcpanel)
- Install a fresh WP (through Softalicious for example)
- You will have a DB for the fresh install (e.g. mynewcpanel_db1)
- Create a new DB (call it with “m” for migration at the end = mynewcpanel_db1m)
- Assign the same DB user as the fresh install auto-created already. You can do that under cPanel > MySQL Databases.
- Go to cPanel > phpMyAdmin.
- Click on your new database “mynewcpanel_db1m” and import your old WP database that you exported (structure and data). Do that via the IMPORT tab.
- Put Search Replace DB folder into your fresh WP install directory. Call it “search-replace-db”.
- Open Search Replace by typing http://xxxx.server.com/~mynewcpanel/search-replace-db.
- Initially do a dry run. It may throw up errors because the table prefix is different (“wp_” for example) - click on “update details”.
- Check if the changes of the dry run look correct by clicking on “view changes” below.
- Do a LIVE RUN to make all the changes.
- Zip the existing wp-content folder in the fresh install (just in case, keep it for now) and delete it. You will have no wp-content folder in your new install after that.
- Upload your zipped and downloaded wp-content folder from the old WP install. Unzip it. You should now have a wp-content folder again.
- Zip the "search-replace-db” folder for later use. And delete the folder (keep the zip). This is IMPORTANT for security reasons ! ! !
- Go to wp-config.php and change database name. Add an “m” so that: define('DB_NAME', 'mynewcpanel_db1m’);
- Change the prefix to your old db prefix: $table_prefix = 'wp_’; (replace “wp_” with whatever you used - “wp_” is the default option)
- Go to http://xxxx.server.com/~mynewcpanel/wp-admin
- Wordpress will start a short settings request: user, pw, email - just input what you prefer the settings to be.
- If Media Library images somehow do not show up on your site, delete the .htaccess file (it will be regenerated if necessary, and see this:
Thats it. The fresh WP install now looks like your old WP content, including media library.
Useful plugins if something goes wrong with the Media Library: https://wordpress.org/plugins/add-from-server/