Change WordPress Domain using http://wp-cli.org/

  1. sudo curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

clip_image001

  1. From User@UbuntuServer:/var/www/html$ I will run the following command to make sure that the command is working

sudo php wp-cli.phar –info

clip_image002

  1. I’ll move the file to a new path and location so I can access it from anywhere using only the command WP.

First I will give the required permissions

moh10ly@Ubunut-Mohammed:/var/www/html$ sudo chmod +x wp-cli.phar

clip_image003

Next I will move the file

sudo mv wp-cli.phar /usr//local/bin/wp

clip_image004

  1. Check if the file is working properly after moving?

clip_image005

  1. Final step is to change the domain of your wordpress site to a new domain.

My previous domain was www.mytechweb.ga and now I changed it to www.moh10ly.website

So I only used two commands to change the domain name to the new one

clip_image006

clip_image007

Now I tested my website and it’s working perfectly…

http://wp-cli.org/

<<wp-cli.phar>>