Back up the WordPress database as a gzip file
backup wordpress database command line | export wordpress db | dump database without password | wp-cli | database | backupwp db export - --path=/var/www/vhosts/example.com/httpdocs | gzip > /var/www/vhosts/example.com/db-backup.sql.gzCreates an SQL dump of the WordPress database via mysqldump and writes it to a compressed file. No credentials need to be entered because WP-CLI takes them from wp-config.php. Ideal before updates, search and replace runs or migrations.
Note: Never store the backup in the web root (httpdocs), otherwise it may be publicly accessible. An existing file with the same name is overwritten.
Also searched as
- backup wordpress database command line
- export wordpress db
- dump database without password