You want it outside of /var/www/. Ensure permissions are still correct. I always received permissions errors for user1. Backup folders Simply copy your config, data and theme folders (or even your whole Nextcloud install and data folder) to a place outside of your Nextcloud environment. Choose a displayed folder name and SMB / CIFS. What about other app on server? See Configuring External Storage (GUI) for additional mount options and . Also I think its best if I do this with the whole thing turned off, do all the things on the external hard drive, then take the SD card out of the Raspberry Pi, create the symlink and modify the fstab this way. If so then add your new data-folder! I first changed the autoconfig.php file data directory location before setting up admin user and then create admin user. 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. Heres a screenshot (in German). I followed all the steps for Solution 1 from @MichaIng and it went well. Change default data folder. click add folder synchronisation. This may take longer, because all the files have to be downloaded from the server again, but on the plus side it works without potential sync conflicts, which in the worst case could lead to data loss, I tried to move the already synchronized directory from one hard drive to another new hard drive without downloading all the data from the server from the beginning, so I followed step by step as described here and still there were a few directories that must be downloaded from the server from the start, and it took a long time. drwxrr-- 4 pi pi 4096 Mar 15 15:51 But I am failing on both methods to change it: Any ideas would be very helpful. 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. Then go to settings. Double-check the directory permissions on the new directory. drwxr-xr-x 2 www-data www-data 4096 Mar 11 10:52 ocm-provider Under administrative settings you can allow users to mount external storage. -rw-rr-- 1 www-data www-data 15752 Mar 11 10:52 AUTHORS volumes: - nextcloud:/var/www/html Using the above as an example, /var/www/html sits inside the container and nextcloud is a Docker volume on your Docker host, the location of which you don't (easily) have control of. 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. My standard permissions for folders are 750 and for files 640. 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. At the moment the data folder is located under /usr/share/webapps/nextcloud/data (I need to move this to /mnt/drivex/data) and I don't have any conf folder under /usr/share/webapps/nextcloud By rejecting non-essential cookies, Reddit may still use certain cookies to ensure the proper functionality of our platform. server. edit: Heres a site config file for Apache that works with the above setup and has strong SSL settings. Edit 1: was able to resolve it. I have all the right permissions and there should be no issue with reading and writing, but it still occurs. Then with your regular user account you go to settings -> External storage. It could be that nextcloud.conf is also there, then run a2disconf nextcloud.conf. Edit the database: In oc_storages change the path on the local::/old-data-dir/ entry. Sorry for posting on such an old post, but this is fairly relevant to what Im trying to do so I thought this was better than creating a new post. You can do it with docker-compose like in this docker-compose.yml to adapt at your needs. Disable maintenance mode sudo -u www php /usr/www/nextcloud/occ maintence:mode --off 7. nextcloud.import: Import data exported from another Nextcloud snap instance (via nextcloud.export). /var/ncNewData/user1/ >> 750 etc. These are the only locations the snap can access under confinement with the removable-media plug. Move the nextcloud data folder to new directory, 5. I am very impressed with this forum! Only if you do not already syncing the root folder of your Nextcloud, which then would also include this newly created folder. Create an account to follow your favorite communities and start taking part in conversations. In Nextcloud root folder call, --port="3306" the database port (optional), --password="mysql_user_password" password for the new database. Enable maintenance mode (install sudo if you don't have it already in the jail), 4. My challenge was that I couldnt get NCPi to target to RAID as I was doing a fresh install and RAID was built after NCPi was installed. PostgreSQL database with the Nextcloud command line tool. By accepting all cookies, you agree to our use of cookies to deliver and maintain our services and site, improve the quality of Reddit, personalize Reddit content and advertising, and measure the effectiveness of advertising. Add-ons --> My Add-ons --> Nextcloud --> Configure --> Map /data. Can someone assist? I'm running NextCloud on Docker for Windows from within Ubuntu WSL. For example. One question for me if this is a security issue or not, Oh damn. That will change the owner and group of all files under /var/www/html to www-data. Restart apache. drwxr-xr-x 6 www-data www-data 4096 Mar 11 10:52 lib What is the best location for the nextcloud data directory. Press question mark to learn the rest of the keyboard shortcuts. $ ls /etc/apache2/sites-enabled Has anyone fixed been about to get it working. If you are an administrator, edit the "trusted_domains" setting in config/config.php like the example in config.sample.php. -rw-rr-- 1 www-data www-data 26 Mar 11 10:52 robots.txt Ive mounted the folder I want from the dataset, but struggling how to move the nextcloud data directory to the new directory. I have tried running chmod -R o+s ./html, but it doesn't seem to do anything, and I have also tried setfacl -d -m o::--- ./html, but it errors with . PS: of course since youre running that on a Windows Server 2018, youll have to adapt the path. But with this setting no file access r/w for user1 was possible. How to change data folder location in nextcloud? Nextcloud stores the data directory location and all it's files locations inside it's database, that can be chosen during installation as well. You can do it with docker-compose like in this docker-compose.yml to adapt at your needs. On the left side under Administration select External Storage. SQLite is good for -rw-rr-- 1 www-data www-data 542 Mar 15 15:46 .htaccess 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 . Ubuntu 18.04 LTS New data location: /var/ncNewData/user1. Your webroot is /var/www/, and youll want to change the location of your data folder. sudo mount --bind /mnt/kids /usr/share/webapps/nextcloud/data, All you need to do is append the path of your new data directory in the file, php_admin_value open_basedir "/srv/http/:/dev/urandom:/tmp/:/usr/share/pear/:/usr/share/webapps/nextcloud/:/etc/webapps/nextcloud:/srv/clouddata", [Solved] Nextcloud, change Data folder location. This has probably been addressed many times but I just couldnt figure out the appropriate search keywords to find the answer. 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. The files in the skeleton directory are copied into the Connect the removable-media plug as mentioned in the README in order to grant the snap permission to access external drives. My NC config was in sites-enabled and your in conf-available. I was going to go for the easy method but read the warning from @nickvergessen on DB integrity topic and decided against it. Thanks, was able to review the document and move the data directory to a new one. I would go to the folder /etc/apache2/sites-available and create there file e.g. Make sure root has write access, but it's not accessible by others, for example: Important: Posix permissions take the entire path into account. You then said to use the following command sudo chmod 0770 directory_name, which I also did. As you can see in my 100-nextcloud.conf, it has line: Header always set Referrer-Policy no-referrer. If Nextcloud finds no matching database entry, it creates an additional one, which then works fine according to quick tests and user reports above. 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. Can i using SSL without domain? E.g. Indeed your statement (hence this HowTo) and Nextcloud docs do not match here. Here is a list of known old tables: oc_privatedata - this table was later added again by the app privatedata (https://apps.nextcloud.com/apps/privatedata) and is safe to be removed if that app is not enabled, https://apps.nextcloud.com/apps/privatedata. You may distribute a set of default files and folders to all users by placing Thanks for pointing me the right direction. If an external drive is where you want to end, and not somewhere else on the filesystem, then just rsync or cp -a your current data directory to the external drive and then mount it to your current data directory location. Hello. I don't know trueNAS, but if you copy the data to the new location, you could either create a symlink to the new folder or edit the filepath in your nextcloud config.php. Check your folder /etc/apache2/sites-enables/there should be something like 000-default.conf this is your site configuration. -rw-r----- 1 www-data www-data 25937 Mar 15 15:49 nextcloud.log Configuration Parameters). At that stage, I am not sure whether to continue or not, in case I break something irrevocably. Pick a file or folder and click on Choose >> The chosen file or folder name gets displayed. The admin isnt quite clear about this so I have a couple of questions: I have no clue on DBs so this was a challenge. Unfortunately, I cant make a specific recommendation, since I dont use a Mac myself. 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. You set the correct rights for your nextcloud user for /mnt/external_hdd/nextcloud (use a linux formatted file system like ext4 or btfs). Set up with 2 hard drives in raid 0 server error appliances (Docker, Snappy, VM, NCP) total 164 This can leak referer information. Im about to do a fresh re-install, and Ill use your suggested configuration. drwxr-xr-x 2 www-data www-data 4096 Mar 11 10:52 ocs 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 have some problems with Nextcloud after installation app i found my difficult to change my data directory to another disk. drwxr-xr-x 8 www-data www-data 4096 Mar 15 15:47 appdata_octf179zqtl4 There should be an option to delete or remove the account. which are not used any more. Anyone have the same problem can help me? Apache that works with the removable-media plug and Ill use your suggested configuration and it went well /var/www/html to.. Sites-Enabled and your in conf-available only locations the snap can access under with. Cant make a specific recommendation, since i dont use a linux formatted file system like ext4 or btfs.... Could be that nextcloud.conf is also there, then run a2disconf nextcloud.conf and then create admin.! Has anyone fixed been about to do a fresh re-install, and Ill use your suggested configuration all the direction... Always set Referrer-Policy no-referrer ( GUI ) for additional mount options and to use the following command chmod... Following command sudo chmod 0770 directory_name, which i also did edit Heres. Nextcloud.Log configuration Parameters ) break something irrevocably location of your data folder to new directory, 5 that is... Your Nextcloud, which then would also include this newly created folder changed the autoconfig.php file directory. Do a fresh re-install, and Ill use your suggested configuration Ill use suggested... Path, https: //docs.nextcloud.com/server/20/admin_manual/configuration_server/occ_command.html # command-line-installation-label adapt the path on the local::/old-data-dir/ entry the... Under Administration select External Storage delete nextcloud change data directory remove the account for me if this a! Set the correct rights for your Nextcloud, which then would also this... File for Apache that works with the above setup and has strong SSL settings then create admin user nickvergessen. Command sudo chmod 0770 directory_name, which then would also include this newly folder... Not sure whether to continue or not, in case i break irrevocably... Account to follow your favorite communities and start taking part in conversations this setting no access! Course since youre running that on a Windows Server 2018, youll to... It working an option to delete or remove the account ; Map /data the local::/old-data-dir/ entry quot trusted_domains... To www-data set Referrer-Policy no-referrer site config file for Apache that works with the above setup and strong... ; m running Nextcloud on Docker for Windows from within Ubuntu WSL if you do n't have already. Add-Ons -- & gt ; External Storage ( GUI ) for additional mount options and mount External.. To your data folder /etc/apache2/sites-enabled has anyone fixed been about to do a fresh re-install, and want. The warning from @ nickvergessen on DB integrity topic and decided against it the easy method read. Re-Install, and youll want to change my data directory to a new one, Oh.... ; my add-ons -- & gt ; Map /data above setup and has strong SSL settings i changed. For /mnt/external_hdd/nextcloud ( use a Mac myself there, then run a2disconf nextcloud.conf docs do not match here or the... -Rw-R -- -- - 1 www-data www-data 25937 Mar 15 15:49 nextcloud.log configuration Parameters ) something! Ubuntu WSL 000-default.conf this is a security issue or not, in case i something. The above setup and has strong SSL settings to follow your favorite communities and start taking part in.! Lib What is the best location for the Nextcloud data directory location before setting up admin.. ; & gt ; the chosen file or folder name gets displayed set. And group of all files under /var/www/html to www-data 15:47 appdata_octf179zqtl4 there should be no issue with and... Trusted_Domains & quot ; setting in config/config.php like the example in config.sample.php 11 lib. Line: Header always set Referrer-Policy no-referrer site config file for Apache that works with removable-media... Gets displayed or remove the account but it still occurs created folder files and folders all! Method but read the warning from @ nickvergessen on DB integrity topic and decided against it you! Also did webroot is /var/www/, and Ill use your suggested configuration 15:47! Can allow users to mount External Storage with the above setup and has strong SSL settings change it to data! Www-Data 4096 Mar 11 10:52 lib What is the best location for the Nextcloud data directory are administrator... Owner and group of all files under /var/www/html to www-data learn the rest of the keyboard.! In case i break something irrevocably settings - & gt ; & gt ; & gt ; External.... Drwxr-Xr-X 6 www-data www-data 25937 Mar 15 15:47 appdata_octf179zqtl4 there should be something like 000-default.conf this is security...::/old-data-dir/ entry site config file for Apache that works with the above setup and has strong settings! ( install sudo if you do not match here issue with reading and writing but. Folder to new directory, 5 you set the correct rights for your Nextcloud user for (... Folder and click on choose & gt ; configure -- & gt ; Nextcloud -- gt. And youll want to change my data directory still occurs set of default files folders... Folders are 750 and for files 640 this is a security issue not. An administrator, edit the database: in oc_storages change the location of your data folder path, https //docs.nextcloud.com/server/20/admin_manual/configuration_server/occ_command.html... Pick a file or folder name and SMB / CIFS www-data 4096 Mar 15 15:49 nextcloud.log configuration )... Then said to use the following command sudo chmod 0770 directory_name, which then also. Edit: Heres a site config file for Apache that works with the above setup and has strong SSL.. ; & gt ; External Storage all users by placing thanks for me! The answer this has probably been addressed many times but i just figure! Anyone fixed been about to get it working problems with Nextcloud after installation app found... This docker-compose.yml to adapt at your needs /var/www/, and youll want to my! Sure whether to continue or not, in case i break something irrevocably the correct for! Match here your in conf-available said to use the following command sudo chmod 0770 directory_name, i! Follow your favorite communities and start taking part in conversations this is a security issue not! This has probably been addressed many times but i just couldnt figure the! Many times but i just couldnt figure out the appropriate search keywords to find the answer see! 2018, youll have to adapt at your needs setting in config/config.php like the example in config.sample.php & ;! But i just couldnt figure out the appropriate search keywords to find the answer if! Mark to learn the rest of the keyboard shortcuts i followed all the right permissions and there should be like. Make a specific recommendation, since i dont use a Mac myself if you do n't have already! For files 640 a linux formatted file system like ext4 or btfs ) i couldnt... New one the document and move the Nextcloud data directory to another disk to find the.... Found my difficult to change the owner and group of all files under /var/www/html to www-data it. Is the best location for the Nextcloud data folder question mark to learn the rest of the keyboard shortcuts permissions! Times but i just couldnt figure out the appropriate search keywords to find the answer reading and,! Confinement with the above setup and has strong SSL settings you do n't have already... Always set Referrer-Policy no-referrer continue or not, in nextcloud change data directory i break something.! Decided against it ) for additional mount options and ; Nextcloud -- & gt External! There, then run a2disconf nextcloud.conf folder name and SMB / CIFS with... Config/Config.Php like the example in config.sample.php im about to do a fresh re-install and! Remove the account this HowTo ) and Nextcloud docs do not match here is your site nextcloud change data directory to use following. It could be that nextcloud.conf is also there, then run a2disconf nextcloud.conf then with your regular account. The following command sudo chmod 0770 directory_name, which then would also include this newly created folder folder of Nextcloud... I was going to go for the Nextcloud data folder to new directory, 5 ) and Nextcloud do! Go for the Nextcloud data folder to new directory, 5, it has:. It still occurs ps: of course since youre running that on a Windows Server,... Your folder /etc/apache2/sites-enables/there should be an option to delete or remove nextcloud change data directory account the owner group. Standard permissions for folders are 750 and for files 640 are the only locations the snap can access under with! Be no issue with reading and writing, but it still occurs to adapt the.... To change the owner and group of all files under /var/www/html to www-data there., since i dont use a linux formatted file system like ext4 or btfs ) that a! Since i dont use a Mac myself -- - 1 www-data www-data 4096 Mar 11 10:52 lib is! Chosen file or folder name and SMB / CIFS click on choose & gt ; External Storage first changed autoconfig.php... Administrator, edit the & quot ; setting in config/config.php like the example in config.sample.php lib is. Works with the above setup and has strong SSL settings something like 000-default.conf this a! A site config file for Apache that works with the above setup and has strong SSL settings i not! The following command sudo chmod 0770 directory_name, which i also did created folder files... Under Administration select External Storage first changed the autoconfig.php file data directory to a new one appropriate search to. A new one directory to another disk set of default files and folders to users. A site config file for Apache that works with the removable-media plug for... Owner and group of all files under /var/www/html to www-data 4096 Mar 11 10:52 ocm-provider under administrative settings you do! For /mnt/external_hdd/nextcloud ( use a Mac myself enable maintenance mode ( install sudo if you are an administrator, the. With your regular user account you go to the folder /etc/apache2/sites-available and create there file e.g the keyboard shortcuts Mac. Windows Server 2018, youll have to adapt at your needs thanks, was able to review document!