NextCloud Disaster Recovery?



  • Just curious what you are doing to recover from a complete failure and breakdown of Nextcloud.

    My NC is using S3 storage and is Cross Region Replicated with Revisions. As well as duplicated via a Desktop client with full sync.

    The one thing that still worries me is the fact that the files are not stored with human readable (or even original) filenames. A non recoverable NC install leaves me without any idea of which file is which. Unless I am missing something......

    What do you do to safeguard your data in NC?



  • @JasGot said in NextCloud Disaster Recovery?:

    The one thing that still worries me is the fact that the files are not stored with human readable (or even original) filenames. A non recoverable NC install leaves me without any idea of which file is which. Unless I am missing something......

    Are you using the Nextcloud encryption? If so, that is why you cannot see files.

    By default everything is stored exactly as it is on the web interface / sync client.

    0_1543633740457_ffadb0fd-592c-47fb-a998-81d89bec9d13-image.png



  • So to answer your question, you backup the instance, just like any other VM.

    Because yours is on AWS, you need to use AWS native tools to snapshot it and download/offsite it from Amazon.

    Or you install some type of agent or setup a script in side the VM to do it.

    Nextcloud uses a database to store all the user and file information and then the /data folder to store all the files and revisions.

    The database is simple to backup as it is simply MariaDB/MySQL.

    The data is also simple to copy to something like B2.



  • Assuming you are protecting against loss of your VM, but not the failure of S3, a normal backup of NC will handle recovery of all of the oddly named files. It will know which is which from its database which is not on S3.



  • @JaredBusch said in NextCloud Disaster Recovery?:

    @JasGot said in NextCloud Disaster Recovery?:

    The one thing that still worries me is the fact that the files are not stored with human readable (or even original) filenames. A non recoverable NC install leaves me without any idea of which file is which. Unless I am missing something......

    Are you using the Nextcloud encryption? If so, that is why you cannot see files.

    By default everything is stored exactly as it is on the web interface / sync client.

    0_1543633740457_ffadb0fd-592c-47fb-a998-81d89bec9d13-image.png

    Aha! Moment here..... It's because I use S3 as the primary storage...... Local primary storage is indeed native filenaming conventions. Thanks for opening that thought @JaredBusch

    I have a NextCloud installed and running at a Linux server, and its configured to have Amazon S3 bucket as the primary storage and if I sync files at local folder its uploaded to the S3 bucket, but the problem is that the files appears as urn:oid:1158
    0_1543683302382_c343391c-1613-4e6c-9ea5-d99fd9fee674-image.png

    Now, does this change any of your thoughts on just making sure the NC database is backed up?

    Assuming I am forced to recover from the Cross Region replication, and no database backup; you can see how I am out of luck. So, with my primary datastore being S3, that database is even more important.



  • @scottalanmiller I snapshot my VM occasionally. This is clearly not sufficient since I upload to NC hourly....



  • @JasGot said in NextCloud Disaster Recovery?:

    So, with my primary datastore being S3, that database is even more important.

    True, you lack the "benefit" of obvious filenames.



  • @JasGot said in NextCloud Disaster Recovery?:

    @scottalanmiller I snapshot my VM occasionally. This is clearly not sufficient since I upload to NC hourly....

    Depends, if "occasionally" means every hour or two, you are probably good 🙂 If it means every few weeks, probably not.



  • I would look at something like Veeam agents.



  • @scottalanmiller Would you accept "Months" 🙂

    My VM Snapshots are primarily to quickly rebuild NC after I mess it up!



  • @JasGot said in NextCloud Disaster Recovery?:

    @scottalanmiller Would you accept "Months" 🙂

    My VM Snapshots are primarily to quickly rebuild NC after I mess it up!

    We built with Salt for that reason. No backup needed for the system itself, only the data. Then we can only back up the database and the files, which is obviously 90% of the stuff so not that much of a benefit, but no need to go back to a snap in order to recover quickly.



  • @scottalanmiller said in NextCloud Disaster Recovery?:

    @JasGot said in NextCloud Disaster Recovery?:

    So, with my primary datastore being S3, that database is even more important.

    True, you lack the "benefit" of obvious filenames.

    The benefit of real file names with Nextcloud is that it allows you to recover even the loss of the database if you have only the files.

    You can spin up a new instance, create all new user accounts matching the names in the folder structure.
    Then you copy the data in and run the command to rescan the files.

    Assuming Fedora with default locations:

    cd /var/www/html/nextcloud
    sudo -u apache php occ files:scan --all