Is there a way to change where the “appdata_instanceid” folder is mapped to? By default, it’s in the Nextcloud data directory. I don’t like this because my Nextcloud data directory is mapped to my HDD array, which is slow for reads.
I want all the small files on a faster SSD; for example, the preview generated files under “appdata_instanceid/preview”.
The Nextcloud log file is also located on the data directory by default (which I find bizarre) but I could change this by adding the line
‘logfile’ => ‘/ssd/config/log/nextcloud/nextcloud.log’,
to my config.php file.
Now I want to do the same thing for the entire appdata_instanceid directory, along with “files_external”, which contains a “rootcerts.crt” file that sometimes gets accessed.
I think it is not a new problem. E.g. i found this issue for you for appdata_instanceid folder and Docker. Maybe you can move the folder to the SSD and use a soft link. Read examples .
jtr
May 23, 2023, 8:15pm
3
There’s a pending PR with support for this here:
nextcloud:master
← summersab:appdata_location
opened 09:20PM - 24 Jan 23 UTC
Allow configuring the location of the `appdata_[instanceid]` folder
* Resolve… s: #12873
## Summary
This allows administrators to change the location of the `appdata_[instanceid]` folder by specifying an `appdataroot` value in `config.php`. This is especially useful when using shared storage, object storage as primary storage (storing `appdata_[instanceid]` in an object store is extremely slow), etc.
## TODO
**Resolved with commit 783ad06**
- [x] Regardless of `appdataroot` being set, the function should really return `$rootFolder` and not `$rootFolder->get($folderName)`. The current code will store files in `/appdata_[instanceid]/appdata_[instanceid]` when an `appdataroot` is provided and `/appdata_[instanceid]` in normal operation (i.e. it will create a `/appdata_[instanceid]` folder on the mount point instead of writing appdata folders to the mount point itself). Some apps such as OnlyOffice expect the `appdata_[instanceid]` folder to be a direct child of system root:
https://github.com/ONLYOFFICE/onlyoffice-nextcloud/blob/504884f16ce2b66e45a66579aa3cdf0fd0197330/lib/templatemanager.php#L53
~~However, I am having permission issues. The system is able to create files and folders at the mount point, but when it tries to read the folders, they don't appear to exist, and errors are thrown. I think it has something to do with the `OC\FilesView` attached to the mount point/folder, but I'm not sure. It seems to occur at this function:~~ ~~https://github.com/nextcloud/server/blob/75d7203f579f5761fc921d9506579bec48ebab74/lib/private/Files/Node/Folder.php#L161~~
If that doesn't make sense, please feel free to ask me to explain in further detail.
## Checklist
- Code is [properly formatted](https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/continuous_integration.html#linting)
- [Sign-off message](https://github.com/src-d/guide/blob/master/developer-community/fix-DCO.md) is added to all commits
- [ ] Tests ([unit](https://docs.nextcloud.com/server/latest/developer_manual/app_development/tutorial.html#unit-tests), [integration](https://docs.nextcloud.com/server/latest/developer_manual/app_development/tutorial.html#integration-tests), api and/or acceptance) are included
- [ ] Screenshots before/after for front-end changes
- [ ] Documentation ([manuals](https://github.com/nextcloud/documentation/) or wiki) has been updated or is not required
- [ ] [Backports requested](https://github.com/nextcloud/backportbot/#usage) where applicable (ex: critical bugfixes)
And the original enhancement request that triggered the PR is here:
opened 05:05AM - 06 Dec 18 UTC
enhancement
1. to develop
I'm using Nextcloud 14.0.4 via the docker image. On my host machine, I mount a C… IFS share to my filesystem, and I use this mounted directory as the data directory for Nextcloud. For performance reasons, my expectation was that Nextcloud would use the data directory as little as possible to avoid IO contention. Basically, it should only ever be used when an actual backed up file is accessed (actual files they sync). After all, the only reason I mount this way is so that the main storage for users goes to my NAS.
However, I'm observing that there's an `appdata_abcdefg` directory there, which has a lot of metadata in it. The most concerning piece of data in there are the image previews. I'd like a way to reduce the amount of usage that Nextcloud puts on the data directory. I'd like it to only store user data files, and the rest should reside on the local filesystem.
Is there a way to do this? How can I prevent metadata from going to my NAS for performance reasons?