Restore Nextcloud from Data Directory

Nextcloud version (eg, 20.0.5): Newest
Operating system and version (eg, Ubuntu 20.04): Newest Docker Image
Apache or nginx version (eg, Apache 2.4.25): Newest Docker Image
PHP version (eg, 7.4): Newest Docker Image

The issue you are facing:

I unfortunately lost my nextcloud installation (main folder, database), but because I still have the data folder with all the user info and data (+ app data), I was wondering if there is some way of restoring an installation without having to manually copy all the users files to newly created users on a new instance.
For example, does it work if I just create a new nextcloud instance, create the users I need, stop the instance, move in the old data directory and start it up again? Will users then have all their settings etc. back?

Thanks in advance!

Will users then have all their settings etc. back?

No, not unless you also have a backup of the database as well. That’s where settings, contacts, calendars, sharing information etc are stored.

Notes are on disk, along with a SQLite database file, as far as I remember.

However reinstalling a fresh Nextcloud instance and copying the data directory back will give your users their files back.

You’ve learned a hard lesson about making (and testing) backups.