Skip to content

Instantly share code, notes, and snippets.

@darkdiesel
Created January 25, 2024 09:03
Show Gist options
  • Save darkdiesel/d352e7e20cda4941d2e246e420cc2e17 to your computer and use it in GitHub Desktop.
Save darkdiesel/d352e7e20cda4941d2e246e420cc2e17 to your computer and use it in GitHub Desktop.
WP replace host in db
# run this from console to update db
php srdb.cli.php -h "127.0.0.1" -n "dbname" -u dbuser -p "dbuserpass" -P 3310 -s "https://host.old" -r "https://host.new" --debug true
# Update wp config with constans that will contain your new host
define( 'WP_HOME', 'https://host.new' );
define( 'WP_SITEURL', 'https://host.new' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment