Page 1 of 1

Full DB Backup

Posted: Sat Apr 21, 2018 6:20 am
by surus
Hello,

How I can create the full db backup?
Our db is around 3GB. If we use the inbuilt vestacp backup, it will be done every night, but the backup files size is around 70MB only.
I mean this cron: sudo /usr/local/vesta/bin/v-backup-users

I need the full backup, that can be used on each other server to restore all user data including full web and full db server.
Please help.

Re: Full DB Backup

Posted: Thu Jun 11, 2020 1:41 pm
by grayfolk
surus wrote:
Sat Apr 21, 2018 6:20 am
Hello,

How I can create the full db backup?
Our db is around 3GB. If we use the inbuilt vestacp backup, it will be done every night, but the backup files size is around 70MB only.
I mean this cron: sudo /usr/local/vesta/bin/v-backup-users

I need the full backup, that can be used on each other server to restore all user data including full web and full db server.
Please help.
You can use mysqldump: https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html

Code: Select all

Simple backup:
mysqldump -u USER -pPASSWORD DATABASE > /path/to/file/dump.sql

Schema only
mysqldump --no-data - u USER -pPASSWORD DATABASE > /path/to/file/schema.sql

Specufy tables
mysqldump -u USER -pPASSWORD DATABASE TABLE1 TABLE2 TABLE3 > /path/to/file/dump_table.sql

Gzipped backup
mysqldump -u USER -pPASSWORD DATABASE | gzip > /path/to/outputfile.sql.gz

Backup filename with current datetime
mysqldump -u USER -pPASSWORD DATABASE | gzip > `date +/path/to/outputfile.sql.%Y%m%d.%H%M%S.gz`