You may need to be at the root of your WP install. In Local by Flywheel this will be the app directory.
wp db export your/path/here/my_wordpress_db.sql
wp db import your/path/here/my_wordpress_db.sql
wp search-replace 'http://oldurl.com' 'http://newurl.com'
Add --dry-run
to test.
You may need to change the siteurl and home url as well.
wp option update home 'http://new.url'
wp option update siteurl 'http://new.url'
wp plugin search "yoast acf"
wp plugin install --activate plug-in-slug
wp plugin install --activate $(<plugin-slugs.txt)
wp plugin install --activate stop-emails modify-comment-parent simple-google-analytics-tracking
wp plugin update --all
git fetch --all
git reset --hard origin/master
or
git reset --hard origin/<branch_name>
brew install wp-cli
If you want to make a export/import a database backup quickly with the commandline and don't want to go to the Local app, right-click your site to ssh in:
- Install wp cli:
brew install wp-cli mysql
if you don't already have these on your system - In your
~/Local Sites/{{ sitefolder }}
folder (app, conf, logs folders are here too):curl -O https://raw.githubusercontent.com/salcode/ssh-into-local-by-flywheel/master/wpcli-lbf-setup && bash wpcli-lbf-setup && rm -rf ./wpcli-lbf-setup
* - In Local, under the Database tab enter the Remote Host ip and Remove Port when prompted by the script
- Your folder should now contain: app, conf, logs, wp-cli.local.php, wp-cli.local.yml
Test to see if it works but opening up a terminal somewhere in your site folder and trying a cli command. Eg. wp option get siteurl
should show your site url. Now you can make backups simply, even from the VSCode terminal: wp db export your/path/here/my_wordpress_db.sql
. Combine this with git lfs
and you can keep your database in your git repo.
https://salferrarello.com/wp-cli-local-by-flywheel-without-ssh/
*I wonder if this could be shortened to curl -s https://raw.githubusercontent.com/salcode/ssh-into-local-by-flywheel/master/wpcli-lbf-setup | bash
wp [email protected]/var/www/html/ plugin list