Backup wordpress before upgrading

That's what the title says, but what is the best way to do it..

I use a combinations of Tar (Tape Archive) and WP-Cli (WordPress Command Line Interface)

#!/usr/bin/env bash

D=$(date +'%Y%m%d%H%M%S')
P="/var/www"
S="bleppe.se"

echo "Dumping database to: ${P}/${S}-${D}.sql"
cd ${P}/${S}
wp --allow-root db export ${P}/${S}-${D}.sql


echo "Backing up with tar: ${P}/${S}-${D}.tgz"
cd ${P}
tar --exclude=${S}/wp-content/uploads -zcf ${S}-${D}.tgz ${S}/