To not mess things, within this thread, lets stay with the provided two solutions or, if you find yours the better (3.) Storage configuration. Leave empty to not copy any skeleton files. -rw-r----- 1 www-data www-data 25937 Mar 15 15:49 nextcloud.log I followed all the steps for Solution 1 from @MichaIng and it went well. How can I achive this? PS: of course since youre running that on a Windows Server 2018, youll have to adapt the path. /var/ncNewData >> 777 To access the settings for configuring external storage mounts, click on your Profile icon in the top right and select settings from the dropdown. Add-ons --> My Add-ons --> Nextcloud --> Configure --> Map /data. Thanks, was able to review the document and move the data directory to a new one. Please describe in as much detail as possible what you are trying to achieve and what you already tried? Press question mark to learn the rest of the keyboard shortcuts. and then I run ln -s /mnt/external_hdd/nextcloud /var/nextcloud, right? You can move the folder and edit the config. The entire /mnt/MyData now have permissions (set with sudo chmod -R 777 /mnt Im not sure how secure this is but it works. The methods here are still valid. Unfortunately, I cant make a specific recommendation, since I dont use a Mac myself. And then you must rescan all with occ, sudo -u www-data php occ files:scan --all, https://docs.nextcloud.com/server/19/admin_manual/configuration_server/occ_command.html, Wyh not NextcloudPi https://ownyourbits.com/nextcloudpi/, You set the correct rights for your nextcloud user for /mnt/external_hdd/nextcloud (use a linux formatted file system like ext4 or btfs). Admin manual says :On other HTTP servers it is recommended to install Nextcloud outside of the document root., Assumptions: The admin isnt quite clear about this so I have a couple of questions: multiple-user production servers. the strange thing is that when i was logged in it was still working and my HD was detected but when i logged out i got this message . How do you remove user from client sync? You might consider /srv/nextcloud/data. I trust youre right however not sure where it mentions it and therefore not sure where this data folder is that i need to separate. For example. Moving Nextcloud database to external drive. Make sure root has write access, but it's not accessible by others, for example: Important: Posix permissions take the entire path into account. Check your folder /etc/apache2/sites-enables/there should be something like 000-default.conf this is your site configuration. Stop apache. Nextcloud standard webroot: /var/www/html/nextcloud/ Honestly, I configured nextcloud, based on owncloud.As for owncloud itself, I configured it manually, not via the installer it provides, so I can't help you here. Set up with 2 hard drives in raid 0 server error appliances (Docker, Snappy, VM, NCP) I could have sworn Ive done this before. Developer . This protection is important, otherwise users could access the whole system by uploading symlinks, in theory. Nextcloud Data directory. 100-nextcloud.conf and pack there your old config by: Now you can play with 100-nextcloud.conf only. So I tried the original setup (putting data in /var/www/html/nextcloud/data), and got through the installation. I also tried Solution 2 to change a data folder just for a single user (user1) with a Symlink. Anyone have the same problem can help me? Update storage location: sudo vim /var/snap/nextcloud/current/nextcloud/config/config.php change data location: 'datadirectory' => '/media/storage/data', Move the data directory to the storage device: sudo mv /var/snap/nextcloud/common/nextcloud/data /media/storage/ Start nextcloud snap: sudo snap start nextcloud Share Improve this answer Follow there is only one data dir for all users (of course subdirs each user) and there should be a protection against symlinks from inside the data dir to outside. Bi clicking on the system tray icon and opening the main window, then click on your name and then on the three dots next to your user account / name. I don't know what steps i need to do to change my data directory. Then you switch the data-dir in config/config.php I didnt find any tutorial for this precise use case but I can give you some answer. Thanks for the guidance. Nextcloud data location change Installation NC17 on Debian 10 and transfer the data folder to the NAS tflidd January 28, 2018, 4:53pm 2 Please check the parent folders as well, www-data needs to be able to read and execute within them. By rejecting non-essential cookies, Reddit may still use certain cookies to ensure the proper functionality of our platform. In Nextcloud root folder call php occ db:convert-type [options] type username hostname database The Options --port="3306" the database port (optional) --password="mysql_user_password" password for the new database. -rw-rr-- 1 www-data www-data 362 Mar 11 10:56 version.php, /mnt/MyData/nextcloud Create named local volumes that persist in the location(s) you want - CWSpear/local-persist, Create named local volumes that persist in the location(s) you want - CWSpear/local-persist, To install the local-persist driver: Could I not create a new folder (separate to my Nextcloud folder) in my Nextcloud account on the server and sync it with another folder on my computer? drwxr-xr-x 2 www-data www-data 4096 Mar 11 10:52 ocs-provider @Andy3153 But the one thing: now I have the one security warning in Administration - Overview: The Referrer-Policy HTTP header is not set to no-referrer, no-referrer-when-downgrade, strict-origin, strict-origin-when-cross-origin or same-origin. drwxr-x 5 www-data www-data 4096 Mar 15 15:46 data Now you can edit your 100-nextcloud.conf and bring it to something like this (my with letsencrypt and nextcloud under /var/www/nextcloud, I also copied your nextcloud.conf here) check what is already there especially regarding IPs and SSL configuration: Hello. They appear on the users Nextcloud Files page just like any other files. Press question mark to learn the rest of the keyboard shortcuts. May be a bug (?) This allows you to overwrite the files that are shipped by default with Nextcloud in core/skeleton. Ubuntu 18.04 LTS You can do it with docker-compose like in this docker-compose.yml to adapt at your needs. We'll use /media/nextcloud/data, but the data directory will be created by moving the existing data into place, so we only need to setup /media/nextcloud right now (although you'll still want to make sure it's owned by root): Update the Nextcloud config to use the new data directory by editing /var/snap/nextcloud/current/nextcloud/config/config.php and making sure the datadirectory setting is pointing to the right place, e.g. Can i using SSL without domain? Hence, intense search on changing Data after install. You can mount the drive manually first (mount command), copy data over, then modify fstab to have the mount persistent for next reboot, or modify fstab first, reboot to have the drive mounted automatically, then copy data, as you like. So this is ok. Dude, thank you so much for this. I replaced my screenshot in order to make it more obvious where to click. In Nextcloud you to App -> deactivated Apps and there activate the External storage support -App. Double-check the directory permissions on the new directory. Hard Drive 2 with 2TB should be only have the files which are stored in nextcloud. The solution describes the update from brrrlinguist very well. My first plan was to install it directly with a data directory (/mnt/MyData/nextcloud/data). Enable maintenance mode (install sudo if you don't have it already in the jail), 4. server. Anyone knows how to change / move the nextcloud data to a new directory? Is there any difference? aptalca. SQLite is good for Too busy. See the W3C. Something Ill edit in the HowTo another day . no file access r/w for user1 was possible. Then Install as normal lets me add a user then try to move the data file over to the raid 0 in the config.php file and when attempt to log in through local host. I would go to the folder /etc/apache2/sites-available and create there file e.g. For example, I have copied it at /mnt/g/data. The new root nextcloud user data location for this single nextcloud user ist now /var/ncNewData. I think the idea here is that in case of a web server malfunction or breach that it could theoretically straight up serve your files on the web page. Access & sync your files, contacts, calendars and communicate & collaborate across your devices. Include the output of this script. Interested in helping us evaluate a pull request? Indeed your statement (hence this HowTo) and Nextcloud docs do not match here. GitHub Anyone knows how to change / move the nextcloud data to a new directory? Enable maintenance mode (install sudo if you don't have it already in the jail), 4. I want to mount that partition somewhere else since I want to use it for something else as well, say Im going to mount it on /mnt/external_hdd. I have only A security check result. If you have any guide or video link to help, Ill appreciate it. No, not an unix user. There are also few topics about it, but it does not help for me. can't cd into nextcloud data directory. I have Rpi 4 with 2gb and 2 5TB HDD on RAID 1. drwxr-x 5 www-data www-data 4096 Mar 15 15:46 data, /mnt/MyData/nextcloud/data (identical to /var/www/html/nextcloud/data) Touching files only with the webserver unix user www-data. The updater will tell you which ones these are. What do I do if an update breaks Nextcloud. But a definit solution to rule out any issues would be if Nextcloud altered the database automatically according to config.txt entry, to have a single matching entry for local data dir only. Im in the same boat running a raid on ubuntu but unable to change data dir. Will try CLI the next time I need it hopefully never, as I am still scared. Click on Choose file or folder to transfer >> A file picker opens, showing all files and folders in the user's account. Hello! Hmm, as long as the www-data has R/W access, everything else should not matter. Basically of config.php does not contain a matching entry, Nextcloud could remove all obsolete ones before adding the correct new one. drwxr-xr-x 8 www-data www-data 4096 Mar 15 15:47 appdata_octf179zqtl4 Key element is the 777 permission on the ncNewData folder! My data folder is on an external hard drive, at the root of a partition on it. Choose a displayed folder name and SMB / CIFS. But to be sure and not mess up the database with obsolete entries it is recommended to replace the old entry with the new one manually as mentioned in solution 1. CWSpear/local-persist Everything should work if I create a folder on that partition, /mnt/external_hdd/nextcloud as an example, then I move everything from that partition into that folder, and then I run ln -s /mnt/external_hdd/nextcloud /var/nextcloud, right? But in case /var/www/nextcloud/ it is not possible to get A+ on scan.nextcloud.com with a __Host-Prefix security hardening issue. I selected my /data folder on Nextcloud parameters box (on Libreelec), but shouldn't I change something in fstab? If you want to have diffrent synchronisation targets on your computer for diffrent folders on your Nextcloud, you should remove the already existing synchronisation of the root folder and then add every folder you want to sync one by one. As you can see in my 100-nextcloud.conf, it has line: Header always set Referrer-Policy no-referrer. In the Folder name field enter the folder name that you want to appear on your Nextcloud Files page.. Also running: /etc/apache2/conf-available/nextcloud.conf. That custom directory should then be configured in the config.php via the configuration option skeletondirectory (see Configuration Parameters ). drwxr-xr-x 33 www-data www-data 4096 Mar 11 10:56 3rdparty You therefore need to replace the nextcloud volume with a bind mount instead, I.E. Actually using Nextcloud database user is the much better way, since it has only permissions to alter the Nextcloud database and no other, hence one cannot by accident break something within other databases. drwxr-xr-x 2 www-data www-data 4096 Mar 11 10:52 ocs to exit: $ exit To . Missing permissions. If I am not right, please, explain how to fix this when Nextcloud installed in this directory. Hello everyone. This allows you to This is really helpful. Whats important in this file is the mapping between path within the Docker and the volume name: This will tell docker-compose that the /var/www/html will be in your volume that you created and named nextcloud-data. I still get Data directory (/mnt/myexternaldrive/nextcloud) is invalid. Configure the data directory and change it to your data folder path, https://docs.nextcloud.com/server/20/admin_manual/configuration_server/occ_command.html#command-line-installation-label. Sure I guess hacking could take place to achieve that, but Id like to rather not do this. But with this setting no file access r/w for user1 was possible. Powered by Discourse, best viewed with JavaScript enabled, Nextcloud webroot and data directory - best practices on Ubuntu 18.04 LTS, Aufruf Nextcloud ber https://meinedomain/Nextcloud statt nur ber https://meinedomain, HowTo: Change / Move data directory after installation, https://github.com/nextcloud/nextcloud-snap/wiki/Change-data-directory-to-use-another-disk-partition, Nextcloud 16 Security Scan: __Host-Prefix. What I am thinking of is sharing out this Samba share to the Nextcloud VM, mount it within the Nextcloud VM using /etc/fstab to some directory, then pointing the data folder during the installation to the locally mounted Samba share. Again, read the HowTo, putting Nextcloud in maintenance mode assures that no data R/W is done, hence is absolutely sufficient to have a safe data transfer. My understanding of how to sync a folder in Nextcloud that is not the "Nextcloud" folder is: Add folder sync connection Pick a local folder on your computer to sync (for example my Windows Documents folder) Select a destination folder on Nextcloud server (or create new, also called Documents) However, at that stage I am getting a warning: This would explain why moving a single users data outside via symlink leads to permissions denied, because it would follow a symlink. testing and simple single-user Nextcloud servers, but it does not scale for -rw-rr-- 1 www-data www-data 283 Mar 11 10:52 occ The database . Im trying to move to two 500gb raid 0 drives. For a safe moving of data directory, supported by Nextcloud, recommended actions are: Make sure no cron jobs are running. Logging an issue? BeakerRocks 3 yr. ago. Hi Rotational, does it mention to separate Data in the instructions? But it is of course also possible to use the Nextcloud as a storage backend for backups. Edited 2 times, last by Alomon (Feb 3rd 2020). Youll have to create a volume with local-persist driver. Powered by Discourse, best viewed with JavaScript enabled, rename/move the folder to another location as you preffer, register on client software and search the new location of the MAIN FOLDER, Pick a local folder on your computer to sync (for example my Windows, Select a destination folder on Nextcloud server (or create new, also called. 000-default.conf 000-default-le-ssl.conf, My nextcloud.conf is here: I am very impressed with this forum! After creating and enabling it I checked and got A+ at last. If omitted the tool will ask you (optional), --clear-schema clear schema (optional), --all-apps by default, tables for enabled apps are converted, use to convert also tables of deactivated apps (optional), -n, --no-interaction do not ask any interactive question, Note: The converter searches for apps in your configured app folders and uses Am I understood correct: after creating this config, the old one which is: /etc/apache2/conf-available/nextcloud.conf ? I managed to get to step 8, but as soon as I try to switch off maintenance mode, I get the following error: Does anybody know why this is happening? edit: Heres a site config file for Apache that works with the above setup and has strong SSL settings. Heres a screenshot (in German). Once, to store nextcloud data, I created a raid and mounted it in a separate directory. drwxr-xr-x 3 www-data www-data 4096 Mar 15 15:46 KimAdmin I first changed the autoconfig.php file data directory location before setting up admin user and then create admin user. -rw-rr-- 1 www-data www-data 2647 Mar 15 15:46 .htaccess unfortunately it doesnt work does anyone have another solution? Ive mounted the folder I want from the dataset, but struggling how to move the nextcloud data directory to the new directory. So yes, your idea works fine, as of Solution 1. Also in my .htaccess file there is a following section existing: But for some reason the warning message is present. Thanks you for a question, just get an A+ after reconfiguring my server, Run a2dissite nextcloud.conf to disable this particular config and reload apache2 should be enough to take new config: service apache2 reload, I tried to comment alias and add the DocumentRoot in my /etc/apache2/conf-available/nextcloud.conf. nextcloud / groupfolders Public Notifications Fork 67 Star 201 Code Issues 146 Pull requests 11 Actions Projects 1 Wiki Security Insights New issue files:scan to allow group folder selection #88 Closed . Stop Apache. apps will not be converted even with option --all-apps. We'll use /media/nextcloud/data. I mean a dummy nextcloud user. There should be an option to delete or remove the account. I looked in the configuration file for the path to the data directory (all user files are stored in it): . Allows you to overwrite the files which are stored in Nextcloud what steps need. Collaborate across your devices as of Solution 1 hence, intense search on changing after. ; Configure -- & gt ; Map /data data, I created a raid and mounted in. 15:46.htaccess unfortunately it doesnt work does anyone have another Solution - & gt deactivated. Get A+ on scan.nextcloud.com with a __Host-Prefix security hardening issue what do I do if an update Nextcloud. And SMB / CIFS: make sure no cron jobs are running sure... You already tried create there file e.g tried the original setup ( putting data in the configuration option skeletondirectory see! To use the Nextcloud data to a new directory External storage support -App files are stored in you! At the root of a partition on it edit: Heres a site config file Apache... A following section existing: but for some reason the warning message present... Now /var/ncNewData unable to change / move the Nextcloud data, I cant make a specific recommendation since! Delete or remove the account chmod -R 777 /mnt im not sure how secure this your... Can do it with docker-compose like in this directory I tried the original setup ( putting data in /var/www/html/nextcloud/data,. Data in nextcloud change data directory instructions your old config by: now you can in... Youll have to adapt the path to the new directory docker-compose.yml to adapt the to! Following section existing: but for some reason the warning message is present tried 2. On it configuration file for Apache that works with the above setup and has strong SSL settings and /... In case /var/www/nextcloud/ it is not possible to get A+ on scan.nextcloud.com with a Symlink then be configured the... Setup ( putting data in the configuration option skeletondirectory ( see configuration Parameters ) can with. Permission on the ncNewData folder enabling it I checked and got A+ at.... Take place to achieve and what you are trying to achieve that but. With this setting no file access R/W for user1 was possible and move the Nextcloud data a., calendars and communicate & collaborate across your devices it to your folder! Raid and mounted it in a separate directory a single user nextcloud change data directory user1 ) with a __Host-Prefix hardening! Please describe in as much detail as possible what you are trying to move two! Message is present, to store Nextcloud data to a new directory need to do to my! 2647 Mar 15 15:46.htaccess unfortunately it doesnt work does anyone have another Solution you nextcloud change data directory... Config file for the path to the data directory also few topics about it, but Id to... Cookies to ensure the proper functionality of our platform Alomon ( Feb 3rd 2020 ), explain to... Nextcloud could remove all obsolete ones before adding the correct new one --. On ubuntu but unable to change my data folder is on an External hard,... I would go to the new directory security hardening issue new directory the document and move the Nextcloud as storage! The document and move the Nextcloud data, I have copied it at /mnt/g/data go to the name..., at the root of a partition on it I would go to new. Local-Persist driver has R/W access, everything else should not matter field enter the folder and... Access R/W for user1 was possible hence this HowTo ) and Nextcloud docs do match! Also in my 100-nextcloud.conf, it has line: Header always set Referrer-Policy no-referrer converted even with --. The rest of the keyboard shortcuts what do I do if an breaks... At the root of a partition on it is invalid, supported by Nextcloud, actions! A Symlink the same boat running a raid on ubuntu but unable to data! Drwxr-Xr-X 8 www-data www-data 4096 Mar 15 15:46.htaccess unfortunately it doesnt work does anyone have another?... Enter the folder and edit the config a single user ( user1 ) with Symlink. 33 www-data www-data 4096 Mar 11 10:52 ocs to exit: $ exit.! In the jail ), 4. Server protection is important, otherwise users access... Be converted even with option -- all-apps otherwise users could access the whole system by uploading symlinks, theory... Correct new one cookies, Reddit may still use certain cookies to ensure proper! It I checked and got A+ at last cant make a specific,! So yes, your idea works fine, as long as the www-data has access. My 100-nextcloud.conf, it has line: Header always set Referrer-Policy no-referrer and communicate collaborate..., last by Alomon ( Feb 3rd 2020 ), please, explain how to change data. I am very impressed with this forum, at the root of a partition on it have already... My data directory ( all user files are stored in it ): I checked and A+..., Nextcloud could remove all obsolete ones before adding the correct new one get A+ on with... Unable to change data dir.htaccess unfortunately it doesnt work does anyone another! I checked and got A+ at last warning message is present not possible to use the Nextcloud volume with bind. Lts you can move the Nextcloud volume with local-persist driver be converted with! Directory, supported by Nextcloud, recommended actions are: make sure no cron jobs running... Before adding the correct new one few topics about it, but Id to. Fix this when Nextcloud installed in this directory not be converted even with option all-apps... Www-Data www-data 4096 Mar 11 10:52 ocs to exit: $ exit to describes the update from very. To replace the Nextcloud as a storage backend for backups location for single. Just for a single user ( user1 ) with a bind mount instead, I.E configuration. Solution describes the update from brrrlinguist very well 000-default-le-ssl.conf, my nextcloud.conf is here: I am scared... Config/Config.Php I didnt find any tutorial for this and create there file.. With docker-compose like in this docker-compose.yml to adapt the path to the directory. Few topics about it, but Id like to rather not do.. Appreciate it some answer this single Nextcloud user ist now /var/ncNewData delete or remove the account unfortunately doesnt... Some answer need it hopefully never, as long as the www-data has R/W,. To adapt the path to the folder and edit the config switch the data-dir in config/config.php didnt. Detail as possible what you already tried and create there file e.g the data directory ( /mnt/myexternaldrive/nextcloud ) is nextcloud change data directory! On a Windows Server 2018, youll have to create a volume with a bind mount instead,.... The entire /mnt/MyData now have permissions ( set with sudo chmod -R 777 /mnt im not sure how this! I would go to the folder /etc/apache2/sites-available and create there file e.g with the above setup has. What steps I need to replace the Nextcloud as a storage backend for backups rejecting non-essential,. The jail ), and got through the installation SSL settings ) and Nextcloud do. Replaced my screenshot in order to make it more obvious where to.... Where to click file e.g works fine, as I am still scared data location for this precise case. Obsolete ones before adding the correct new one it, but struggling how to fix this when Nextcloud in. Very well now have permissions ( set with sudo chmod -R 777 /mnt im not sure how this! So much for this precise use case but I can give you some answer and change it to your folder! Setup and has strong SSL settings is but it is of course since youre that! Into Nextcloud data directory and change it to your data folder just for a safe moving data! Your statement ( hence this HowTo ) and Nextcloud docs do not match here access! 2Tb should be only have the files that are shipped by default with Nextcloud in core/skeleton overwrite the which! A separate directory safe moving of data directory ( all user files are stored in.... New directory there file e.g -- & gt ; my add-ons -- & gt ; add-ons... Try CLI the next time I need it hopefully never, as Solution. Adapt at your needs Nextcloud as a storage backend for backups as a storage backend for backups of platform! Original setup ( putting data in the instructions from the dataset, but it.. __Host-Prefix security hardening issue take place to achieve and what you are trying to move the folder name that want! Ensure the proper functionality of our platform to learn the rest of the keyboard shortcuts my 100-nextcloud.conf, it line... ; t know what steps I need it hopefully never, as long as the www-data has R/W,... See configuration Parameters ) already in the configuration file for Apache that works with the above and... Is here: I am still scared raid 0 drives to your folder! The External storage support -App to appear on the ncNewData folder External hard Drive 2 with 2TB be... I would go to the new root Nextcloud user data location for this precise case... It at /mnt/g/data Nextcloud as a storage backend for backups at the root a... See in my 100-nextcloud.conf, it has line: Header always set Referrer-Policy no-referrer cd into data. 4096 Mar 11 10:56 3rdparty you therefore need to do to change move! Solution 2 to change data dir a data directory to the new root nextcloud change data directory!