New NextCloud Setup

Status
Not open for further replies.

Scrat_

Explorer
Joined
May 3, 2018
Messages
95
I have my first NextCloud setup, but.. I've made a new one that's not broken.

My db and files folders are stored outside of my original NextCloud install. What is the best way to access these files and database from my new installation?

I know the username and password of the database. NextCloud is not set up for server-side encryption, the home storage is encrypted.

Thanks in advance!
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
I'm not sure I fully understand the question. Are you asking about how to make the folders visible to your nextcloud jail? If so, you can mount a directory from your host into a jail using fstab

If you're asking about restoring your old database, this documentation might help
 

Scrat_

Explorer
Joined
May 3, 2018
Messages
95
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.
 
Last edited:

Scrat_

Explorer
Joined
May 3, 2018
Messages
95
Is it possible to leave out the settings and/or configuration of NextCloud? I'm strictly interested in the data.
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
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!
 
Last edited:

Scrat_

Explorer
Joined
May 3, 2018
Messages
95
Well, if that's what's in the db folder, that may not be needed to copy (or map) over. When I say map, I mean edit the mount point(s) where the data is to the new install.

The few notes I have, I can easily copy n paste. I played with contacts a bit, but there's only four entries.

The db and files folders are located outside the iocage so if the jail got messed up, the data wouldn't go with it. This is why re-mapping sounds good.. I just don't know how the new NextCloud iocage will treat it.
 
Status
Not open for further replies.
Top