WP-DEPLOY : Cannot Push database

Jeremy Dixon asked:

So I’ve been trying to set up Wp-Deploy for about 3 weeks now šŸ™

I have a digitalocean droplet that I am using for staging and was able to finally get my local environment to deploy the files to the server, however, I cannot get the database commands to work. When I try and backup the database I get the following output

    [email protected] /var/www/html $ bundle exec cap staging db:backup
00:00 db:backup_name
      01 mkdir -p /var/www/vhosts/thedixonbuilds.com/httpdocs/shared/db_backups
    āœ” 01 [email protected]<ip address> 1.748s
      02 wp db export - | gzip > /var/www/vhosts/thedixonbuilds.com/httpdocs/shared/db_backups/20190210165609.sql.gz
      02 /usr/bin/env:
      02 ā€˜wpā€™
      02 : No such file or directory
      02
    āœ” 02 [email protected]<ip address> 0.244s
      Downloading db_backups/20190210165609.sql.gz 100.0%
      03 rm /var/www/vhosts/thedixonbuilds.com/httpdocs/shared/db_backups/20190210165609.sql.gz
    āœ” 03 [email protected]<ip address> 0.228s

and when I try and run the db:push

00:00 db:backup_name
      01 mkdir -p /var/www/vhosts/thedixonbuilds.com/httpdocs/shared/db_backups
    āœ” 01 [email protected]<ip address> 1.399s
      02 mkdir -p db_backups
    āœ” 02 [email protected] 0.003s
      03 wp db export - | gzip > db_backups/20190210170146.sql.gz
    āœ” 03 [email protected] 0.271s
      Uploading db_backups/20190210170146.sql.gz 100.0%
      04 gzip -c -d /var/www/vhosts/thedixonbuilds.com/httpdocs/shared/db_backups/20190210170146.sql.gz | wp db import -
      04 bash: wp: command not found
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: gzip exit status: 127
gzip stdout: Nothing written
gzip stderr: bash: wp: command not found


Caused by:
SSHKit::Command::Failed: gzip exit status: 127
gzip stdout: Nothing written
gzip stderr: bash: wp: command not found
/var/www/html/lib/capistrano/tasks/db.rake:148:in `block (4 levels) in <top (required)>'
/var/www/html/lib/capistrano/tasks/db.rake:147:in `block (3 levels) in <top (required)>'
Tasks: TOP => db:push
(See full trace by running task with --trace)

I’m not sure how capistrano achieves the database manipulation or what usr/bin/env is supposed to contain. Can anyone help me with some leads?

Thanks!

My answer:


Both of those failed for the same reason. Did you not see the errors?

Here they are:

      02 /usr/bin/env:
      02 ā€˜wpā€™
      02 : No such file or directory

And:

gzip stderr: bash: wp: command not found

Both times, your script is trying to run the wp command, but it is not installed or not in your PATH. You need to install it first, and second make sure your PATH is set correctly.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.