- Run the following commands via SSH.
mkdir -p ~/bin \
&& curl -o ~/bin/wp-cli.phar https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& curl -o ~/bin/wp-completion.bash https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash \
&& curl https://gist.githubusercontent.com/kauhat/8e8d79a8197558b73298/raw/.bashrc >> ~/.bashrc \
&& echo "source ~/bin/wp-completion.bash" >> ~/.bash_profile; \
source ~/.bash_profile && source ~/.bashrc;
- Tweak your
.bashrc
file if necessary. Don't forget to reload it by runningsource ~/.bashrc
.
The provided .bashrc
file adds the ~/bin
directory to the path so that you can use programs installed there easily from the terminal. You can check the version of php
being by using which php
. If it doesn't exist or is the wrong version, you can modify the alias line in your .bashrc
.
tar cvzf backup.tar.gz public_html
wp db export backup.sql --path=public_html
Replace public_html
with wherever the site lives.
Install WP-CLI to your ~/bin directory. Edit the last line if you've got it installed elsewhere.