Mixd / wp-deploy

Capistrano powered WordPress deployment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to backup database?

vukhanhtruong opened this issue · comments

Hi,

When I try to backup remote database, I got stuck with the following issue:

$ bundle exec cap production db:backup --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke db:backup (first_time)
** Execute db:backup
** Invoke db:backup_name (first_time)
** Execute db:backup_name

Please help me, thank you very much.

My enviroment:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Release:	16.04
Codename:	xenial

$ ruby -v
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]

$ wp --info
PHP binary:	/usr/bin/php7.0
PHP version:	7.0.15-0ubuntu0.16.04.4
php.ini used:	/etc/php/7.0/cli/php.ini
WP-CLI root dir:	phar://wp-cli.phar
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/var/www/wp-deploy
WP-CLI packages dir:	
WP-CLI global config:	
WP-CLI project config:	
WP-CLI version:	1.2.1

$ php -v
PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.15-0ubuntu0.16.04.4, Copyright (c) 1999-2017, by Zend Technologies

Hi @vukhanhtruong can you send me over the output from the command too?

Thanks for your support. That's exactly what I get when run the command above. Nothing more.
Am I missing something?

** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke db:backup (first_time)
** Execute db:backup
** Invoke db:backup_name (first_time)
** Execute db:backup_name

@vukhanhtruong No problem, happy to help! Can you let me know what the output is without the --trace flag.

@lukewhitehouse It shows nothing.

@vukhanhtruong strange! Have you filled in your database details within your config/database.yml file? In addition, are your server details filled in at config/deploy/production.rb?

Yes, I did. I can deploy to production. Everything is working fine, except these commands regarding to DB.

@vukhanhtruong And when you go to the root of your local codebase, you do not see the .sql export of the live database?

Yes, there is no sql file.

Also, I can remotely access database from locally. I really appreciate your support. Thank you.

It works somehow. The following article helps me solve problem. Keep your good work up. Thank you very much.
https://makandracards.com/makandra/6047-make-capistrano-use-ssh-key-forwarding

@vukhanhtruong ah thanks for letting me know about this, I'll be sure to add it to the FAQ!