Created
March 24, 2016 11:59
-
-
Save harryfinn/65f90d419b3f2ba688de to your computer and use it in GitHub Desktop.
Revisions
-
Harry Finn created this gist
Mar 24, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # Instructions for using WP-CLI to migrate a WordPress DB ``` # Export current (local) DB wp db export db.sql # Copy file from local to server (may need to amend server path if not in html folder) # The example below is for local to remote, simply swap these 2 around for remote to local scp -r db.sql www-data@IP_ADDRESS:/var/www/html # SSH onto box (should be same connection details as above) ssh www-data@IP_ADDRESS # Run the WP CLI DB importer wp db import db.sql # Use --dry-run first to check that changes will be OK in DB wp search-replace old-site-url.co.uk new-site-url.co.uk --dry-run wp search-replace old-site-url.co.uk new-site-url.co.uk # Delete imported DB file rm db.sql ```