Steps to upgrade Nextcloud from one version to another.

1.  Put the Nextcloud instance into maintenance mode
    docker exec --user www-data nextcloud-app-1 php occ maintenance:mode --on

    Note that 'docker exec' is used to run commands within the Nextcloud docker container; and '--user www-data' is used to run as the user that owns all of the Nextcloud files.

2.  Back up the Nextcloud container's files to a location outside the container's mounted volume.  'rsync' is recommended:

    rsync -Aavx /mnt/storage/appdata/nextcloud/www/ <backup-target-dir>/

    rsync should be run as root.  rsync with these options should preserve file ownership & permissions

3.  Back up MariaDB database:

        docker exec nextcloud-db-container-name mysqldump --single-transaction -h localhost -u nextcloud_user -pnextcloud_password nextcloud_db_name > nextcloud-sqlbkp_$(date +"%Y%m%d").bak
