Question for backup and restore

Good Day,

To all,

First nice work for the nextcloud,
FYI I’m newbie using linux…

We are looking for the cloud storage for archiving.
And we want to try and evaluate the nextcloud.

I already install nextcloud in ubuntu 18.04 using snap.

Because I installed using snap all are automatically installed the requirements

I saw the details of the server in settings after log in is PHP version, MYSQL for database, and nextcloud version

Question for backup and restore
How can i create nextcloud main folder backup
How can i create database backup
and how to restore…

and how can i view the database credentials (database name and user)

Thank you in advance and More Power

Database credentials are in your config/config.php.


  • set nextcloud in maintenance mode via occ
  • Create a tar.gz of the nextcloud installation folder
  • Create a tar.gz of the nextcloud data folder (if it is not inside the installation folder, which it should not)
  • Create a mysqldump of the database
  • Deactivate maintenance mode via occ

To restore: all in reverse

1 Like

follow the

backup is configured if you define a backup target:

that was the easy part.

  1. there no restore script yet. although it’s easy to restore using restic. if you know how. have a look at the restic manual.
  2. backup to the same filesystem makes no sense. better you backup to some kind of cloud storage (aws, azure, digitalocean,…). you’ll find some examples in my repo and restic/rclone docu. but it can be challenging.
  3. you won’t be happy with nextcloud using my playbook if you don’t have basic linux skills. it just save you from copy&pasting one of the many howtos out there. but in case of an outage you have to fix the problem on your own.
1 Like

Thank you Sir @DecaTec for the scripts