Autonomía digital y tecnológica

Código e ideas para una internet distribuida

Linkoteca. occ


To backup NextCloud database, first you need to find out the database name by running the following command on your NextCloud server.

sudo mysql -u root -e "show databases"

As you can see, my NextCloud database name is nextcloud. Once you have identified the NextCloud database name, use mysqldump utility to make a backup like below. Replace red text with your own NextCloud database name.

sudo mysqldump -u root nextcloud-database-name > ~/nextcloud.sql

o back up NextCloud config folder, first cd into Nextcloud installation directory. (Depending on your setup, your Nextcloud installation directory may be different. For example, If you set up Nextcloud with LAMP stack, the directory might be /var/www/nextcloud/. If you set up Nextcloud with LEMP stack, the data directory might be /usr/share/nginx/nextcloud/).

cd /var/www/nextcloud/

Then use tar to back up the config folder.

sudo tar -cpzvf ~/nextcloud-config.tar.gz config/

Run the post-upgrade routine.

sudo -u www-data php7.4 /var/www/nextcloud/occ upgrade