Where I don’t know any way to do that for sqlite, for mysql/mariadb with root access this is quite simple. To avoid this whole file index recreation problem, the oc_storages database table could be manually adjusted from within the database server. Other related information, like shares, tags, comments, previews etc., on the other hand are connected to the old file IDs, thus will be lost. The remaining problem now is, that recreating the file index will also create new file IDs. Your files will be now accessible again through Nextcloud. Sudo -u www-data php /path/to/nextcloud/occ files:scan -all For apache webserver the full command would look like: Nextcloud itself will regularly clean oc_filecache from old/obsolete entries (by cron job occ files:cleanup), but the new entries would need to be manually created by running occ files:scan -all. So by just moving the data directory to another location and change the 'datadirectory' directive inside config.php, the oc_filecache will be full of wrong entries from the old location, where the files entries for the new location are missing, thus no files will be shown inside Nextcloud. If a file is not listed inside this table, it can’t be handled by Nextcloud, nor will it be seen inside the web ui. Other than it’s name suggests, it is actually not a cache, more an index of all files inside the data directory. Therefore it creates the tables oc_storages for the data directory and oc_filecache for the files. ![]() Nextcloud stores the data directory location and all it’s files locations inside it’s database, that can be chosen during installation as well. Nextcloud looks up the location of the data directory inside its /path/to/nextcloud/config/config.php by the 'datadirectory' directive: Configuration Parameters - Nextcloud latest Administration Manual latest documentationĪs seen '/path/to/nextcloud/data' is default value/location, if it is not changed during Nextcloud installation process. Consider re-installing Nextcloud with new data directory, if you did not use it too much/added users/created shares/tags/comments etc. There is already a good thread that handles this topic: Is there a safe and reliable way to move data directory out of web root?įirst of all: Changing data directory after installation is not officially supported. ![]() ![]() Thanks for the hint Also NextCloudPi might provide own solutions: GitHub - nextcloud/nextcloudpi: □ Build code for NextcloudPi: Raspberry Pi, Odroid, Rock64, Docker, curl installer.Īs there still appear questions about that topic, I thought sum up all possibilities here in howto would be a good idea. The official Nextcloud VM has the data already located on a separate ZFS partition, which you can easily raise in size or even add a new drive to the ZFS pool.If you use the Nextcloud Docker container, the GitHub page might give some hints as well: GitHub - nextcloud/docker: ⛴ Docker image of Nextcloud.If you use Nextcloud Snap, follow their official simple instructions: Change data directory to use another disk partition.Note that this HowTo does not apply to Nextcloud containers/appliances or the official Nextcloud VM from Hansson IT.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |