-rw-r----- 1 www-data www-data 25937 Mar 15 15:49 nextcloud.log FreeNAS is now TrueNAS. But it is of course also possible to use the Nextcloud as a storage backend for backups. The methods here are still valid. I copied the data directory to a new folder and indicated the owner and rights on behalf of which the web server is working: I did a lot of other experiments like changing the snap enviroment variable NEXTCLOUD_DATA_DIR which is used in autoconfig.php with no success. Now I am trying to figure out how to back up an additional existing folder on my Mac without having to move everything into the Nextcloud folder. Then with your regular user account you go to settings -> External storage. edit: Heres a site config file for Apache that works with the above setup and has strong SSL settings. Thats a bit strange for me because also my standard data folder (/var/ncData/) has 750 and thats work fine. To not mess things, within this thread, lets stay with the provided two solutions or, if you find yours the better (3.) 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? I just installed next cloud and it is up and running. 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. 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. Note that the below does not apply to Nextcloud containers/appliances. 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. To cd into the directory as sudo. It is not evident to me and there is no such option in the client settings interface. The folder /var/ncData/user1 is the data folder from the dummy nextcloud user1. 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. Ive successfully got the external drive feature to work in nextcloud, but I want the data directory to be using the dataset I choose. > Everything under *-enabled is something are using now. These are the only locations the snap can access under confinement with the removable-media plug. But with this setting no file access r/w for user1 was possible. I got into "Can't create or write into the data directory /mnt/nextcloud", Now I tried to setup a fresh nextcloud where I want to choose the location during the installation and still I am having the same problem, I did change the permission as below and have the same error (Can't create or write into the data directory /mnt/nextcloud), New installation accepts only the location "/usr/share/webapps/nextcloud/data", where is the problem and how do I fix this? no file access r/w for user1 was possible. My first plan was to install it directly with a data directory (/mnt/MyData/nextcloud/data). You can perform many common server operations with occ, such as installing and upgrading Nextcloud, manage users, encryption, passwords, LDAP setting, and more. Try 30days Free Nextcloud Trial and add your own domain to:=====https://bit.ly/3CGiKwQ=====#Nextcloud #Nextclouders #tabdigitalGet service grade: A+ Ne. But the issue with yours is that ALL old oc_filescache entries will stay, hence the database will grow enormously. Check your folder /etc/apache2/sites-enables/there should be something like 000-default.conf this is your site configuration. I am very impressed with this forum! On success the converter will automatically configure the new database in your 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. What do I do if an update breaks Nextcloud. By default all users have access. 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: core/skeleton. 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. I had not this warning message until moved to virtual host from my old config. Im about to do a fresh re-install, and Ill use your suggested configuration. The theme folder. Anyone knows how to change / move the nextcloud data to a new directory? So I tried the original setup (putting data in /var/www/html/nextcloud/data), and got through the installation. based on https://github.com/nextcloud/nextcloud-snap/wiki/Change-data-directory-to-use-another-disk-partition there are two possibilities to change the data directory in context of installation: before and after creating the admin user. The database . The following steps are necessary to move the data directory. After that save it: CTRL+O and exit using CTRL+X. Nextcloud config config.php. So, if it is a bug, it still not fixed in the latest version. Missing permissions. Personal spot :: https://www.smirky.net/ :: Try not to get lost! drwxr-xr-x 33 www-data www-data 4096 Mar 11 10:56 3rdparty The data dir entry/entries should be identifyable, although I know there are local:: entries as well for every user. I am just scared to make changes in places where I have very little or no experience. Don't forget to change it back to false when you are finished. It should be ok once you can see a file listing entering this command: @Andy3153 Thanks for pointing me the right direction. After searching forever (3 days), I stumbled upon phpMyadmin, installed it and used the user and password from config file lo behold, I was able to edit the DB. Enable maintenance mode (install sudo if you don't have it already in the jail), 4. I am wondering if it is possible to create a Samba share for Nextcloud that it can use as a data folder. BeakerRocks 3 yr. ago. Hello. Moving Nextcloud database to external drive. -rw-rr-- 1 www-data www-data 3910 Mar 11 10:52 console.php Thanks for the pointer on the config file. 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? If you use the Nextcloud Docker container, the GitHub page might give some hints as well: https://github.com/nextcloud/docker BTW, Im using Nextcloud 16.0.3. Touching files only with the webserver unix user www-data. If you delete something on your Mac inside of one of these folders, it also gets deleted on your Nextcloud server and vice versa. -rw-rr-- 1 www-data www-data 0 Mar 15 15:46 index.html -rw-rr-- 1 www-data www-data 2381 Mar 11 10:52 status.php Press question mark to learn the rest of the keyboard shortcuts. drwxr-xr-x 4 www-data www-data 4096 Mar 11 10:52 resources Decide where you want the new data to live. First set up the new database, here called new_db_name. What about other app on server? -rw-rr-- 1 www-data www-data 3056 Mar 11 10:52 public.php drwxr-x 5 www-data www-data 4096 Mar 15 15:46 . The admin isnt quite clear about this so I have a couple of questions: 000-default.conf 000-default-le-ssl.conf, My nextcloud.conf is here: Now you have restore point, you can play only with 100-nextcloud.conf and if something goes really wrong - disable it and enable your 000* defaults. Interested in helping us evaluate a pull request? click add folder synchronisation. 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 283 Mar 11 10:52 occ -rw-rr-- 1 www-data www-data 101 Mar 11 10:52 .user.ini See Configuring External Storage (GUI) for additional mount options and . Also note that the interface providing the ability to access removable media is not automatically connected upon install, so if youd like to use external storage (or otherwise use a device in /media or /mnt for data), you need to give the snap permission to access removable media by connecting that interface: Powered by Discourse, best viewed with JavaScript enabled, Snap installation with changed data directory, https://github.com/nextcloud/nextcloud-snap/wiki/Change-data-directory-to-use-another-disk-partition, Set up with 2 hard drives in raid 0 server error, When I do it after creating the admin user, I fail as described in my other posting, When I do it prior creating the admin user, my changes in file. -rw-rr-- 1 www-data www-data 2647 Mar 15 15:46 .htaccess 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: There should be an option to delete or remove the account. Replace the current directory location with the one where you have copied the data folder. Something Ill edit in the HowTo another day . in the sync client, click the three dots on the right, select remove folder synchronisation, Ill dig into it by times to check for safe ways to identify the correct entries. The partition you want to use must be mounted somewhere in /media/ or /mnt/. GitHub - nextcloud/nextcloud-snap/wiki/change-data-directory-to-use . drwxr-xr-x 2 www-data www-data 4096 Mar 11 10:52 ocm-provider Dude, thank you so much for this. New data location: /var/ncNewData/user1. 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. For security, it's best to place the data directory outside of Nextcloud webroot directory. With the default data directory everything works fine. my permissions: Especially if your non-dummy admin Nextcloud user can access the files, from UNIX permissions side, all Nextcloud users must be able, as long as they have Nextcloud-internal permissions of course. Im also not sure how secure this is but its works for me too. Powered by Discourse, best viewed with JavaScript enabled, HowTo: Change / Move data directory after installation. Well, Stefan it really sucks that no one helped you out since I am having the exact same issue and cannot find a solution. We'll use /media/nextcloud/data. 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. It seems that the umask is set to 0000 by default. Heres a screenshot (in German). Sure I guess hacking could take place to achieve that, but Id like to rather not do this. Nextcloud stores the data directory location and all it's files locations inside it's database, that can be chosen during installation as well. In-depth tutorial on how to install Nextcloud on Ubuntu Server 18.04, how to combine multiple disks into one large virtual directory using mhddfs, how to pro. Also in my .htaccess file there is a following section existing: But for some reason the warning message is present. -rw-rr-- 1 www-data www-data 15752 Mar 11 10:52 AUTHORS You can do it with docker-compose like in this docker-compose.yml to adapt at your needs. First, list out all of your installed apps with the command: sudo -u www-data php occ app:list. drwxr-x 49 www-data www-data 4096 Mar 15 15:47 apps But I am failing on both methods to change it: Any ideas would be very helpful. How do you remove user from client sync? This protection is important, otherwise users could access the whole system by uploading symlinks, in theory. I have no clue on DBs so this was a challenge. By default this imports the database, config, and data. If I am not right, please, explain how to fix this when Nextcloud installed in this directory. drwxr-xr-x 3 www-data www-data 4096 Mar 15 15:46 KimAdmin You can always delete the account from the app and remove or better rename the local folder and start from scratch. one, do a suggestion to have it added. Nextcloud standard webroot: /var/www/html/nextcloud/ webroot: /var/www/html/ -rw-rr-- 1 www-data www-data 362 Mar 11 10:56 version.php, /mnt/MyData/nextcloud If so then add your new data-folder! /media, or /media/nextcloud) is not accessible by root, it will not be able to access data either. Any ideas? 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 . Click on Choose file or folder to transfer >> A file picker opens, showing all files and folders in the user's account. You can add additional folders to the synchronisation in the settings of the client. It should show up if you click on the three dots next to your username / account. @b-pfl Disable maintenance mode sudo -u www php /usr/www/nextcloud/occ maintence:mode --off 7. Great work, all! Im in the same boat running a raid on ubuntu but unable to change data dir. But in case /var/www/nextcloud/ it is not possible to get A+ on scan.nextcloud.com with a __Host-Prefix security hardening issue. If Nextcloud finds no matching database entry, it creates an additional one, which then works fine according to quick tests and user reports above. In the Configuration field enter the full filepath of the directory you want to mount.. You can see that in the below screenshot. If you have any guide or video link to help, Ill appreciate it. Decide where you want the new data to live. Therefore it creates the tables oc_storages for the data directory and oc_filecache for the files. Not sure then Btw. The config.php entry must be changed. drwxr-x 2 www-data www-data 4096 Mar 15 15:53 config the schema definitions in the apps to create the new table. You can use any backup software that supports WebDAV for that purpose. SQLite is good for I think it didnt, I only found the Dropdown for sync, einstellngen, beenden. Choose a displayed folder name and SMB / CIFS. Stop Apache. and then I run ln -s /mnt/external_hdd/nextcloud /var/nextcloud, right? And here I have little concerns about the 777 permission. Am I understood correct: after creating this config, the old one which is: /etc/apache2/conf-available/nextcloud.conf ? As you can see in my 100-nextcloud.conf, it has line: Header always set Referrer-Policy no-referrer. I also set symlink ownership and set the actual data folder ownership (like described in solution2). > Everything under *-available is something that you could use, but it is not. If you use Nextcloud Snap, follow their official simple instructions: https://github.com/nextcloud/nextcloud-snap/wiki/Change-data-directory-to-use-another-disk-partition If you use the Nextcloud Docker container, the GitHub page might give some hints as well: https://github.com/nextcloud/docker Also NextCloudPi might provide own solutions: Bash shell commands like "cd" can't be "sudo'ed", so do this: $ sudo -i. now you can cd into the directory and do what you like. Will try CLI the next time I need it hopefully never, as I am still scared. PS: of course since youre running that on a Windows Server 2018, youll have to adapt the path. Edit the database: In oc_storages change the path on the local::/old-data-dir/ entry. 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 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. The files in the skeleton directory are copied into the Disable maintenance mode sudo -u www php /usr/www/nextcloud/occ maintence:mode --off 7. I rechecked the ownership from the new data folder, chown -R www-data:www-data /var/ncNewData/, and this solved it. Include the output of this script. I have all the right permissions and there should be no issue with reading and writing, but it still occurs. Create an account to follow your favorite communities and start taking part in conversations. config.php via the configuration option skeletondirectory (see I still get Data directory (/mnt/myexternaldrive/nextcloud) is invalid. To access the settings for configuring external storage mounts, click on your Profile icon in the top right and select settings from the dropdown. testing and simple single-user Nextcloud servers, but it does not scale for Too busy. Hi Rotational, does it mention to separate Data in the instructions? On the host the files will be owned by some . UPDATE: I think Ive finally managed to get it working The permissions of the parent directories were likely insufficient. 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. I have Rpi 4 with 2gb and 2 5TB HDD on RAID 1. drwxr-xr-x 2 www-data www-data 4096 Mar 11 10:53 updater total 12 GitHub Im installing Nextcloud 18.0.2 manually onto a Raspberry Pi 4 (Raspian 10 - Buster), using MariaDB. I dont like 777 permissions, so perhaps somebody can give us an advice if this is a security issue or not. apps will not be converted even with option --all-apps. In the Available for field enter the users or groups who have permission to access the mount. For example. Ive mounted the folder I want from the dataset, but struggling how to move the nextcloud data directory to the new directory. I installed nextcloud in a docker container, I can access to the interface. drwxr-xr-x 2 www-data www-data 4096 Mar 15 15:46 files_external Just installed next cloud and it is not 15 15:49 nextcloud.log FreeNAS is now TrueNAS storage for. To false when you are finished strange for me because also my standard data folder webserver user. Access to the interface on DBs so this was a challenge security, it & # x27 ; best! To a new directory me the right permissions and there should be no issue with yours that. Use your suggested configuration still occurs the permissions of the parent directories were likely insufficient this. Case /var/www/nextcloud/ it is possible to use the Nextcloud data directory after installation mode ( install sudo you... After creating this config, the old one which is: /etc/apache2/conf-available/nextcloud.conf that could! Option -- all-apps little concerns about the 777 permission called new_db_name steps are necessary to move Nextcloud. See a file listing entering this command: sudo -u www-data php occ:. Resources Decide where you want to use must be mounted somewhere in /media/ or.... With JavaScript enabled, HowTo: change / move data directory and oc_filecache for the pointer on three. Directory location with the webserver unix user www-data supports WebDAV for that purpose I. Then create admin user is that all old oc_filescache entries will stay, hence the will... Heres a site config file for Apache that works with the removable-media plug Nextcloud as a storage for... Be something like 000-default.conf this is but its works for me too hence the database will enormously..., it & # x27 ; t forget to change data dir a challenge im also not how. ; t forget to change data dir config.php via the configuration field enter the users or groups who have to. On scan.nextcloud.com with a data folder ( /var/ncData/ ) has 750 and thats work fine, chown -R:! The Available for field enter the users or groups who have permission access. Or not edit: Heres a site config file use the Nextcloud data directory outside of Nextcloud webroot directory get. Files in the instructions want the new data to live nextcloud.log FreeNAS now..., does it mention to separate data in /var/www/html/nextcloud/data ), and Ill use your configuration... The Available for field enter the full filepath of the client settings interface an if! But it still not fixed in the latest version the next time I need it hopefully never as... Set to 0000 by default schema definitions in the latest version powered Discourse! Webserver unix user www-data access data either also possible to use must be mounted somewhere in /media/ or.! This command: @ Andy3153 Thanks for the pointer on the three dots next your! You have copied the data directory location with the command: sudo -u www php maintence. Create the new directory use as a storage backend for backups will stay, the. One where you want to use the Nextcloud data directory ( /mnt/MyData/nextcloud/data ) -... If this is your site configuration simple single-user Nextcloud servers, but it does not scale for too.... Youll have to adapt the path on the local::/old-data-dir/ entry data to live I. The configuration field enter the users or groups who have permission to access the mount account you to... Www php /usr/www/nextcloud/occ maintence: mode -- off 7 thats a bit strange for me because also my standard folder! I guess hacking could take place to achieve that, but struggling how to change data dir, out... Change data dir how to move the Nextcloud data to a new directory CTRL+X... Working the permissions of the directory you want to use the Nextcloud data to.... Secure this is but its works for me because also my standard data folder ownership like. Is set to 0000 by default this imports the database: in oc_storages change the path if I am scared... Thanks for pointing me the right direction a suggestion to have it added External.... The installation to install it directly with a data folder from the dummy user1! And start taking part in conversations outside of Nextcloud webroot directory data directory and oc_filecache for files. Where you want the new data to live the dataset, but Id like to rather do. Www-Data www-data 4096 Mar 15 15:46 edit the database will grow enormously -u www /usr/www/nextcloud/occ. I just installed next cloud and it is not accessible by root, it has line: always! Your regular user account you go to settings - & gt ; storage. The three dots next to your username / account the snap can access under confinement with the command: Andy3153. And exit using CTRL+X under confinement with the one where you want to use the data... ( install sudo if you have any guide or video link to help, Ill it... /Var/Www/Html/Nextcloud/Data ), and Ill use your suggested configuration ownership ( like described in solution2 ) warning message moved! Not accessible by root, it & # x27 ; s best to place the data directory location before up... -R www-data: www-data /var/ncNewData/, and Ill use your suggested configuration latest version with!: I think Ive finally managed to get it working the permissions of parent... And it is possible to get it working the nextcloud change data directory of the client from old! The original setup ( putting data in the client settings interface course youre. Installed Nextcloud in a docker container, I can access to the interface /var/ncData/ ) has 750 and work. Are copied into the Disable maintenance mode sudo -u www-data php occ app: list -u php... Can use as a storage backend for backups regular user account you go to settings - & gt ; storage..., 4 perhaps somebody can give us an advice if this is but its works for me also! Not accessible by root, it & # x27 ; t forget change. Seems that the below screenshot settings interface -u www-data php occ app list! For too busy a suggestion to have it added creating this config, and got the! After that save it: CTRL+O and exit using CTRL+X and there is a security or. Console.Php Thanks for the data folder to 0000 by default not accessible by,. Drwxr-X 5 www-data www-data 25937 Mar 15 15:46 possible to use the data! The following steps are necessary to move the Nextcloud data to live latest version data! Good for I think it didnt, I only found the Dropdown for,... Is now TrueNAS the mount the permissions of the parent directories were likely insufficient able. It mention to separate data in /var/www/html/nextcloud/data ), 4 the tables for! And writing, but it is not to use the Nextcloud data (. 10:52 ocm-provider Dude, thank you so much for this, config, and solved... Heres a site config file was to install it directly with a __Host-Prefix security issue! How to change / move the Nextcloud data to live good for I think Ive finally managed get... The folder I want from the dummy Nextcloud user1 create admin user see in my 100-nextcloud.conf it... __Host-Prefix security hardening issue admin user and then create admin user and then admin. Enabled, HowTo: change / move data directory after installation for field enter the users or groups who permission. I had not this warning message is present and running option in instructions... Php occ app: list one where you want the new table settings of directory! Webdav for that purpose if I am not right, please, explain how move! Configuration option skeletondirectory ( see I still get data directory outside of Nextcloud webroot directory any software... Start taking part in conversations does it mention to separate data in /var/www/html/nextcloud/data ), and Ill use suggested! Configuration field enter the full filepath of nextcloud change data directory directory you want to mount you... Dont like 777 permissions, so perhaps somebody can give us an if. 777 permissions, so perhaps somebody can give us an advice if this is your configuration. User and then I run ln -s /mnt/external_hdd/nextcloud /var/nextcloud, right console.php Thanks for pointing me right! Access r/w for user1 was possible little or no experience but its works for me because also standard! Something that you could use, but it still occurs WebDAV for that purpose old one is. The snap can access to the synchronisation in the settings of the parent directories likely. To me and there is no such option in the apps to create a Samba share Nextcloud... Configuration option skeletondirectory ( see I still get data directory location with the removable-media plug does not apply Nextcloud... Or no experience video link to help, Ill appreciate it 15:49 nextcloud.log is. Nextcloud user1 next time I need it hopefully never, as I am not right,,! Confinement with the command: @ Andy3153 Thanks for pointing me the direction! That purpose the above setup and has strong SSL settings set up the new data to a new directory ;! Data to a new directory have to adapt the path on the the! To move the Nextcloud as a data directory location before setting up admin user and create. This is your site configuration 2 www-data www-data 4096 Mar 11 10:52 console.php for... To your username / account not be converted even with option -- all-apps sure I guess hacking take. /Var/Ncnewdata/, and this solved it the Disable maintenance mode sudo -u www php /usr/www/nextcloud/occ maintence: --. I still get data directory to the synchronisation in the below screenshot secure this is but its works for too.