Recover from backup without database dump

Hello,

I had a small nextcloud instance running on a raspberry pi. on which I had to reinstall the os. Before doing this, I made a copy (using rsync -a) of the nextcloud directory, and also the nextcloud data directory which I had put in a separate place as advised. I did not, unfortunately, make a dump of the database.

So my question is, what’s the quickest way to restore nextcloud to what it was before, given that I only had about 5 users? I would like to keep calendar info and things like this if possible, is this stored in the database?

Incidentally just before this happened I updated Nextcloud. Does the updater by any chance make a database dump?

Thanks!

yes and also users credentials and information.

If you goes to major release - 99% yes. Also between some minor releases there are changes in db happens.

Only thing that you can do if you have no DB at all, is to install NC and create same users that were before. Then copy data directory back to NC and run command to scan files on HDD:

sudo -u www-data php occ files:scan 

More about command you can read under: Using the occ command — Nextcloud 15 Administration Manual 15 documentation

First, thanks for your reply!

If you goes to major release - 99% yes. Also between some minor releases there are changes in db happens.

I think I went from 14.0.3 to 14.0.6, so probably not, but if if did, where would the database dump be? I did upgrade from 13 to 14 quite recently, this would probably be good enough.

Only thing that you can do if you have no DB at all, is to install NC and create same users that were before. Then copie data directory back to NC and run command to scan files on HDD:

ok, thanks, that’s what I thought, in this case, does it matter if I upgrade to 15 at the same time?

The default is /var/lib/mysql, but this is not the dump, but DB itself.
If you manage to restore it - you have to run 2 commands to make NC 15 works good. One will be listed on your admin/about page (I do not remember) and another is listed here: BigInt (64bit) identifiers — Nextcloud 15 Administration Manual 15 documentation

Without DB it does not matter. Just create users and then put data content back to it. Only things like:

data/updater-*
data/appdata_*/preview
data/USERNAME/files_trashbin
data/USERNAME/files_versions

you can live - they will not produce any benefit without DB, just do not copy them.

The default is /var/lib/mysql , but this is not the dump, but DB itself.

Yes, sorry, I thought you were saying the updater might do a database dump, and was wondering where this might be stored in case it’s still around. However, I think just reinstalling, making new users again, and then copying the data is the way to go.

Thanks for your help!