I'm asking if it's possible to map the db and files folder locations, or will it get corrupted?
The article might be useful.. but I don't wanna restore anything aside from the db and files folder, as there are some mild flaws.
As mentioned, mounting your host directories in the jail is as simple as using fstab. To do this I think you would need to follow the restore instructions in the linked documentation to make your new installation is compatible with the database you have.
A number of posts deal with the fstab syntax, but to provide a quick description, you'' need to use this command from the command line:
Code:
iocage fstab -a <jailname> /path/to/source/folder /path/to/destination nullfs <ro/rw> 0 0
or, as an example:
Code:
iocage fstab -a nextcloud /mnt/volume/cloudStorage /mnt/data nullfs rw 0 0
then the folder /mnt/volume/cloudStorage would be available inside the jail as /mnt/data with read/write access. Looking at the schema of the nextcloud database:
Code:
+-----------------------------+
| Tables_in_nextcloud |
+-----------------------------+
| oc_accounts |
| oc_activity |
| oc_activity_mq |
| oc_addressbookchanges |
| oc_addressbooks |
| oc_appconfig |
| oc_authtoken |
| oc_bruteforce_attempts |
| oc_calendar_invitations |
| oc_calendar_resources |
| oc_calendar_rooms |
| oc_calendarchanges |
| oc_calendarobjects |
| oc_calendarobjects_props |
| oc_calendars |
| oc_calendarsubscriptions |
| oc_cards |
| oc_cards_properties |
| oc_comments |
| oc_comments_read_markers |
| oc_credentials |
| oc_dav_shares |
| oc_directlink |
| oc_federated_reshares |
| oc_file_locks |
| oc_filecache |
| oc_files_trash |
| oc_flow_checks |
| oc_flow_operations |
| oc_group_admin |
| oc_group_user |
| oc_groups |
| oc_jobs |
| oc_migrations |
| oc_mimetypes |
| oc_mounts |
| oc_notifications |
| oc_notifications_pushtokens |
| oc_oauth2_access_tokens |
| oc_oauth2_clients |
| oc_preferences |
| oc_properties |
| oc_schedulingobjects |
| oc_share |
| oc_share_external |
| oc_storages |
| oc_systemtag |
| oc_systemtag_group |
| oc_systemtag_object_mapping |
| oc_trusted_servers |
| oc_twofactor_backupcodes |
| oc_twofactor_providers |
| oc_users |
| oc_vcategory |
| oc_vcategory_to_object |
| oc_whats_new |
+-----------------------------+
As you can see, it looks like the database does a bit more than manage file operations, and might be what you want to exclude to start a fresh installation with your current files. My suggestion would be to back up your files somewhere, run a fresh installation and use your equivalent of "cloudStorage" as the data folder for your new installation, and see what happens. Hopefully if your users have the same usernames it will default to using the existing folders and just work. You won't know until you try though!