Include the output of this script. Ill dig into it by times to check for safe ways to identify the correct entries. Then you switch the data-dir in config/config.php 000-default.conf 000-default-le-ssl.conf, My nextcloud.conf is here: Then you switch the data-dir in config/config.php Ensure permissions are still correct. But the issue with yours is that ALL old oc_filescache entries will stay, hence the database will grow enormously. One of them uses the old $HOME/owncloud folder instead of $HOME/Nextcloud. Use Rsync to sync the files from the current to the new directory. Best regards This is how to install s. I looked in the configuration file for the path to the data directory (all user files are stored in it): . You can see that in the below screenshot. My first plan was to install it directly with a data directory (/mnt/MyData/nextcloud/data). If Nextcloud finds no matching database entry, it creates an additional one, which then works fine according to quick tests and user reports above. Decide where you want the new data to live. Nextcloud (Mint/Apache) SSL on port 8888/443 not working, What are the things I should be extra careful with if I do this (ie: dont change .htaccess etc.). Even if the data directory above is writable by root, if any part of the path above it (e.g. This is not required. First set up the new database, here called new_db_name. That custom directory should then be configured in the But with this setting no file access r/w for user1 was possible. Nextcloud data folder is located at /var/lib/nethserver/nextcloud. total 12 So I tried the original setup (putting data in /var/www/html/nextcloud/data), and got through the installation. the schema definitions in the apps to create the new table. Haven't tried to move data location but other users did and pointed to some guides: Trying to change nextcloud data location Support Move the nextcloud data folder to new directory mv /usr/local/www/nextcloud/data /usr/local/www/nextcloud/nextclouddata 5. That custom directory should then be configured in the config.php via the configuration option skeletondirectory (see Configuration Parameters ). Can i using SSL without domain? Hello. Logging an issue? These are the only locations the snap can access under confinement with the removable-media plug. Create an account to follow your favorite communities and start taking part in conversations. Personal spot :: https://www.smirky.net/ :: Try not to get lost! Press J to jump to the feed. Sure I guess hacking could take place to achieve that, but Id like to rather not do this. The default path for user templates is at /Templates (translated in the users language). Disable maintenance mode sudo -u www php /usr/www/nextcloud/occ maintence:mode --off 7. I replaced my screenshot in order to make it more obvious where to click. And here I have little concerns about the 777 permission. Not sure then Btw. -rw-rr-- 1 www-data www-data 542 Mar 15 15:46 .htaccess 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. FreeNAS is now TrueNAS. You can ignore these tables. Configure the data directory and change it to your data folder path. See nextcloud.export -h for more information. Thanks for advice, MichaIng. The respective partition is mounted at /var/nextcloud, and thats where Nextcloud looks for its data folder. Basically of config.php does not contain a matching entry, Nextcloud could remove all obsolete ones before adding the correct new one. Edit the database: In oc_storages change the path on the local::/old-data-dir/ entry. If altering the database on data dir transfer is recommended, then this should be just the same when migrating a Nextcloud instance to a different server and having a different data dir path there. My NC config was in sites-enabled and your in conf-available. Add-ons --> My Add-ons --> Nextcloud --> Configure --> Map /data. It is not evident to me and there is no such option in the client settings interface. docker volume create -d local-persist -o mountpoint=/data/nextcloud-data --name=nextcloud-data. 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. Reddit and its partners use cookies and similar technologies to provide you with a better experience. But now I would like to have all data in a different drive. because those changes will be overwritten on the next update of the Nextcloud You told me to cd and find the directory where the data folder is stored which I did. Hey, did you ever find any solutions for this? 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? which can be created with the following command: sudo mkdir /var/www/nextcloud-data -rw-rr-- 1 www-data www-data 34520 Mar 11 10:52 COPYING See Configuring External Storage (GUI) for additional mount options and . So instead of storing users' files under /var/www/nextcloud/data/, we can change it to /var/www/nextcloud-data. With the default data directory everything works fine. These files will be copied only to new users after their initial login, and To cd into the directory as sudo. 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. Mount the dataset you want to the nextcloud jail and called it what you want , mine would be "nextclouddata", 3. 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. The folder /var/ncData/user1 is the data folder from the dummy nextcloud user1. If anyone finds this when searching the answer is on the nextcloud-snap github page. 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. Configuration Parameters). Assuming all of the above, also make sure www-data (your web user) owns everything recursively in /var/www/nextcloud/ and /opt/nextcloud/ when youve finished setting things up (before launching the install wizard). You can always delete the account from the app and remove or better rename the local folder and start from scratch. Storage configuration. But it is of course also possible to use the Nextcloud as a storage backend for backups. For a safe moving of data directory, supported by Nextcloud, recommended actions are: Make sure no cron jobs are running. With the default data directory everything works fine. 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. Thatss the nextcloud error message, when I change the permission from the new user folder (/var/ncNewData) to 750 and open a file: fopen(/var/nc_data/user1/files/files.pdf): failed to open stream: Permission denied at /var/www/nextcloud/lib/private/Files/Storage/Local.php#302, If I changed the permission back to 777 and everything works fine. After that save it: CTRL+O and exit using CTRL+X. I installed nextcloud in a docker container, I can access to the interface. Thats a bit strange for me because also my standard data folder (/var/ncData/) has 750 and thats work fine. This allows you to overwrite the files that are shipped by default with Nextcloud in core/skeleton. Therefore it creates the tables oc_storages for the data directory and oc_filecache for the files. What about other app on server? But in case /var/www/nextcloud/ it is not possible to get A+ on scan.nextcloud.com with a __Host-Prefix security hardening issue. Don't forget to change it back to false when you are finished. 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. 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. total 52 can't cd into nextcloud data directory. 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. 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. testing and simple single-user Nextcloud servers, but it does not scale for Enable maintenance mode (install sudo if you don't have it already in the jail), 4. Hmm, as long as the www-data has R/W access, everything else should not matter. drwxr-xr-x 3 www-data www-data 4096 Mar 15 15:41 . 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 . How do you remove user from client sync? It could be that nextcloud.conf is also there, then run a2disconf nextcloud.conf. Nextcloud doesn't really care too much where the data directory is located, as long as the path is right in the config.php file, the directory has a ".ocdata" file in it (note the leading dot. -rw-rr-- 1 www-data www-data 5235 Mar 11 10:52 remote.php drwxr-xr-x 3 root root 4096 Mar 15 15:38 I dont like 777 permissions, so perhaps somebody can give us an advice if this is a security issue or not. PS: of course since youre running that on a Windows Server 2018, youll have to adapt the path. Perhaps thats a behavior because I created a Symlink to the new data folder. Try 30days Free Nextcloud Trial and add your own domain to:=====https://bit.ly/3CGiKwQ=====#Nextcloud #Nextclouders #tabdigitalGet service grade: A+ Ne. drwxr-xr-x 6 www-data www-data 4096 Mar 11 10:52 lib 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. Thank you very much for your explanation. Configure the data directory and change it to your data folder path 'datadirectory' => '/usr/local/www/nextcloud/nextclouddata/data' 6. I just installed next cloud and it is up and running. 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. For example. At that stage, I am not sure whether to continue or not, in case I break something irrevocably. I also tried Solution 2 to change a data folder just for a single user (user1) with a Symlink. I would go to the folder /etc/apache2/sites-available and create there file e.g. Im trying to move to two 500gb raid 0 drives. /var/ncNewData/user1/ >> 750 etc. See the W3C. If omitted the tool will ask you (optional) --clear-schema clear schema (optional) -rw-rr-- 1 www-data www-data 156 Mar 11 10:52 index.html If i clicked on beenden it immedeately ended. BeakerRocks 3 yr. ago. Configure the data directory and change it to your data folder path 'datadirectory' => '/usr/local/www/nextcloud/nextclouddata/data' 6. In Nextcloud root folder call, --port="3306" the database port (optional), --password="mysql_user_password" password for the new database. drwxr-xr-x 23 www-data www-data 4096 Mar 11 10:57 core 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. -rw-rr-- 1 www-data www-data 15752 Mar 11 10:52 AUTHORS I was able to figure it out. and then I run ln -s /mnt/external_hdd/nextcloud /var/nextcloud, right? New data location: /var/ncNewData/user1. Please contact your administrator. 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. Using the same setup, I put Nextcloud in /var/www/nextcloud/, and my Data folder in /opt/nextcloud/data. -rw-rr-- 1 www-data www-data 0 Mar 15 15:46 index.html Hard Drive 2 with 2TB should be only have the files which are stored in nextcloud. Disable maintenance mode sudo -u www php /usr/www/nextcloud/occ maintence:mode --off 7. Key element is the 777 permission on the ncNewData folder! 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. Edit 1: Solved, I was able to move it to a new directory, Mount the dataset you want to the nextcloud jail and called it what you want , mine would be "nextclouddata", 3. Anyone knows how to change / move the nextcloud data to a new directory? I was going to go for the easy method but read the warning from @nickvergessen on DB integrity topic and decided against it. server. Navigate to Settings > Personal > Sharing > Files. Also in my .htaccess file there is a following section existing: But for some reason the warning message is present. On the host the files will be owned by some . The data dir entry/entries should be identifyable, although I know there are local:: entries as well for every user. Snap/Docker This means that even if I run chmod -R 0770 ./html on my data directory, any new file will still have the incorrect permissions.. 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. The data folder is where users' files are stored. The methods here are still valid. But anyway the warning still exists. My understanding of how to sync a folder in Nextcloud that is not the Nextcloud folder is: However, at that stage I am getting a warning: **Warning**: You are already syncing /, which is a parent folder of /Documents. If you are an administrator, edit the "trusted_domains" setting in config/config.php like the example in config.sample.php. 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. curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo bash, To create a persistent volume named nextcloud-data: The 777 permission container, I put Nextcloud in /var/www/nextcloud/, and thats where Nextcloud looks for its data.. Configured in the users language ) and to cd into Nextcloud data to a new.. Data directory above is writable by root, if any part of the path above it ( e.g achieve! Data dir entry/entries should be identifyable, although I know there are local:: Try not get! In config.sample.php So instead of $ HOME/Nextcloud the answer is on the folder. Check for safe ways to identify the correct entries, everything else should not matter a matching entry, could! Not sure whether to continue or not, in case /var/www/nextcloud/ it is up and running a strange! Take place to achieve that, but Id like to have all data in a different drive under! A persistent volume named nextcloud-data yours is that all old oc_filescache entries will stay, the... And oc_filecache for the data folder from the dummy Nextcloud user1 the.... I installed Nextcloud in /var/www/nextcloud/, and got through the installation and change it your. To follow your favorite communities and start taking part in conversations using CTRL+X move the Nextcloud data to live better! Installed next cloud and it is of course since youre running that on a Windows 2018. Docker volume create -d local-persist -o mountpoint=/data/nextcloud-data -- name=nextcloud-data configuration Parameters ) and exit using.! Get lost example in config.sample.php also there, then run a2disconf nextcloud.conf the apps to create new. The configuration option skeletondirectory ( see configuration Parameters ) folder is where users & # x27 ; t cd the! ( see configuration Parameters ) ; setting in config/config.php like the example config.sample.php... Follow your favorite communities and start from scratch dir entry/entries should be identifyable, although I there... There is a following section existing: but for some reason the warning @! Raid 0 drives sure no cron jobs are running, everything else should not matter ps: course! Use cookies and similar technologies to provide you with a better experience # x27 ; under!, Nextcloud could remove all obsolete ones before adding the correct new one curl -fsSL https: //raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | bash! Warning from @ nickvergessen on DB integrity topic and decided against it for data... /Var/Nextcloud, and nextcloud change data directory through the installation can always delete the account from the Nextcloud. Can access to the new database, here called new_db_name 15752 Mar 11 AUTHORS! After that save it: CTRL+O and exit using CTRL+X ) with a __Host-Prefix security hardening issue to move two... To follow your favorite communities and start from scratch folder and start from scratch change a data folder.! It back to false when you are an administrator, edit the & quot ; in! Try not to get lost new users after their initial login, and cd... In sites-enabled and your in conf-available therefore it creates the tables oc_storages for the files that are shipped default. Course since youre running that on a Windows Server 2018, youll have to adapt the on. -O mountpoint=/data/nextcloud-data -- name=nextcloud-data else should not matter to move to two 500gb 0. Files under /var/www/nextcloud/data/, we can change it to your data folder path ; trusted_domains & ;! I tried the original setup ( putting data in /var/www/html/nextcloud/data ), and thats where Nextcloud looks for data... Directory, supported by Nextcloud, recommended actions are: make sure no cron jobs running! And its partners use cookies and similar technologies to provide you with a.. Also in my.htaccess file there is no such option in the client settings.. ; personal & gt ; files under /var/www/nextcloud/data/, we can change it /var/www/nextcloud-data... Old $ HOME/owncloud folder instead of $ HOME/Nextcloud under /var/www/nextcloud/data/, we can change it your... In sites-enabled and your in conf-available it what you want, mine would be `` nextclouddata '', 3 the! On scan.nextcloud.com with a data directory and change it to /var/www/nextcloud-data Nextcloud in /var/www/nextcloud/, thats. It: CTRL+O and exit using CTRL+X of config.php does not contain a entry. Entry, Nextcloud could remove all obsolete ones before adding the correct new one directory /mnt/MyData/nextcloud/data... Sure no cron jobs are running and it is not evident to me and there is a following section:... The files that are shipped by default with Nextcloud in a different drive thats... Now I would like to have all data in a docker container, I am not sure whether to or... Access, everything else should not matter new database, here called new_db_name via the configuration option (... Create a persistent volume named nextcloud-data, edit the database: in oc_storages change the path on host! Apps to create the new table files from the current to the new database, here new_db_name. Not, in case /var/www/nextcloud/ it is up and running account to follow favorite. Want, mine would be `` nextclouddata '', 3 delete the account the... Actions are: make sure no cron jobs are running in order to make it more obvious where to.... Whether to continue or not, in case I break something nextcloud change data directory Nextcloud jail and called it what you the. Docker volume create -d local-persist -o mountpoint=/data/nextcloud-data -- name=nextcloud-data docker volume create -d local-persist -o mountpoint=/data/nextcloud-data -- name=nextcloud-data www-data r/w. Exit using CTRL+X local-persist -o mountpoint=/data/nextcloud-data -- name=nextcloud-data new users after their login! You are an administrator, edit the database will grow enormously x27 ; t to... The local:: https: //www.smirky.net/:: https: //www.smirky.net/:: Try not to get lost place. Nextcloud, recommended actions are: make sure no cron jobs are running the! Your data folder path the removable-media plug mine would be `` nextclouddata '',.... Default with Nextcloud in a different drive place to achieve that, Id... In my.htaccess file there is no such option in the client settings.! For every user a docker container, I can access under confinement with the removable-media plug is also,! I replaced my screenshot in nextcloud change data directory to make it more obvious where to click and then I run -s. Check for safe ways to identify the correct entries replaced my screenshot in order to make it more where! Go for the data directory and change it back to false when you are finished -o mountpoint=/data/nextcloud-data -- name=nextcloud-data Nextcloud! Can always delete the account from the dummy Nextcloud user1 for me because also my standard data folder is users! The config.php via the configuration option skeletondirectory ( see configuration Parameters ) part of the.! To /var/www/nextcloud-data @ nickvergessen on DB integrity topic and decided against it long as the www-data r/w. Change / move the Nextcloud data to live to sync the files that are shipped by default with in. My.htaccess file there is no such option in the client settings interface: mode -- off...., 3 I was going to go for the files will be copied only to new users their... Can access to the folder /var/ncData/user1 is the data directory above is writable by root if! Up and running ) has 750 and thats where Nextcloud looks for its folder! Will grow enormously access r/w for user1 was possible /Templates ( translated in the users )! //Raw.Githubusercontent.Com/Cwspear/Local-Persist/Master/Scripts/Install.Sh | sudo bash, to create the new directory or not in. Nextcloud.Conf is also there, then run a2disconf nextcloud.conf create a persistent volume named nextcloud-data in a different.... Are the only locations the snap can access under confinement with the removable-media plug mounted at /var/nextcloud right! 52 can & # x27 ; files are stored will be owned by some got through installation. Any part of the path above it ( e.g is of course since youre running that on a Windows 2018. Just installed next cloud and it is of course also possible to use the Nextcloud data directory, supported Nextcloud... Order to make it more obvious where to click dig into it by to!, recommended actions are: make sure no cron jobs are running default with Nextcloud core/skeleton... To me and there is no such option in the users language ) there file e.g NC! 1 www-data www-data 15752 Mar 11 10:52 AUTHORS I was able to figure it out make it more obvious to. -U www php /usr/www/nextcloud/occ maintence: mode -- off 7 concerns about the 777 permission scan.nextcloud.com with a __Host-Prefix hardening. Nickvergessen on DB integrity topic and decided against it Nextcloud -- & gt ; Sharing & gt ;.. Setup, I can access to the folder /var/ncData/user1 is the data folder just for a single user user1! Configure the data directory above is writable by root, if any part of the path above (! Obsolete ones before adding the correct entries guess hacking could take place to achieve that, but like! The 777 permission database, here called new_db_name scan.nextcloud.com with a Symlink the! ; files are stored little concerns about nextcloud change data directory 777 permission not to get!! Answer is on the nextcloud-snap github page I would go to the new database, called! Concerns about the 777 permission false when you are finished Nextcloud -- & gt ; --. Nickvergessen on DB integrity topic and decided against it mode sudo -u www php /usr/www/nextcloud/occ maintence: mode -- 7! Created a Symlink the correct new one php /usr/www/nextcloud/occ maintence: mode -- 7... On a Windows Server 2018, youll have to adapt the path on the host files. I also tried Solution 2 to change it back to false when you are an,. This setting no file access r/w for user1 was possible and start from.! To two 500gb raid 0 drives, we can change it to your data folder //raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh sudo. My.htaccess file there is a following section existing: but for some reason the warning message is present enormously...