How to perform WordPress backups using wp-cli?

You can use the WP-CLI command wp db export <filename>

Run the command from within the home directory for the install.

Now, you have a database included in your files. Zip up the directory and move it aside. Now you can perform the upgrade, and if something breaks, replace with the old site and import the old database. voila, previously working site restored.