nextcloud change data directory

You can perform many common server operations with occ, such as installing and upgrading Nextcloud, manage users, encryption, passwords, LDAP setting, and more. Hmm, as long as the www-data has R/W access, everything else should not matter. By default this imports the database, config, and data. You want it outside of /var/www/. Update the Nextcloud config to use the new data directory by editing /var/snap/nextcloud/current/nextcloud/config/autoconfig.php and making sure the directory setting is pointing to the right place, e.g. and then I run ln -s /mnt/external_hdd/nextcloud /var/nextcloud, right? So, I have 3 computers syncing files with a nextcloud 12 server. The only thing that I had to do slightly different was to grant access to the www user and group to the mounted dataset. It should be ok once you can see a file listing entering this command: So yes, your idea works fine, as of Solution 1. Configure the data directory and change it to your data folder path 'datadirectory' => '/usr/local/www/nextcloud/nextclouddata/data' 6. Nextcloud's occ command (origins from "ownCloud Console") is Nextcloud's command-line interface. 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). /media, or /media/nextcloud) is not accessible by root, it will not be able to access data either. Ive got Nextcloud installed onto a Raspberry Pi 4 with 2 GB of RAM, running Arch Linux ARM with a LEMP stack. Create an account to follow your favorite communities and start taking part in conversations. It seems that the umask is set to 0000 by default. Any ideas? You may distribute a set of default files and folders to all users by placing 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. Nextcloud directory can be found at /usr/share/nextcloud. What exactley does not work? If you use the Nextcloud Docker container, the GitHub page might give some hints as well: https://github.com/nextcloud/docker Thanks, was able to review the document and move the data directory to a new one. core/skeleton. Then go to settings. Thanks for the pointer on the config file. Hi Rotational, does it mention to separate Data in the instructions? 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. Pick a file or folder and click on Choose >> The chosen file or folder name gets displayed. 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 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.). Ill dig into it by times to check for safe ways to identify the correct entries. curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo bash, To create a persistent volume named nextcloud-data: I just installed next cloud and it is up and running. Im having the same issue and have uploaded my issues cannt change data directory before or after adding admin. Thanks for advice, MichaIng. However you will want to relocate your data folder completely outside the web folder. 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. 000-default.conf - per default serving you HTTP requests with document root /var/www/html. Thus, I use the same. I followed all the steps for Solution 1 from @MichaIng and it went well. @Andy3153 UPDATE: I think Ive finally managed to get it working The permissions of the parent directories were likely insufficient. total 164 But after this Ive got Not Found trying to open my Nextcloud in a browser. Hello. Only if you do not already syncing the root folder of your Nextcloud, which then would also include this newly created folder. With the default data directory everything works fine. Then with your regular user account you go to settings -> External storage. drwxr-x 5 www-data www-data 4096 Mar 15 15:46 data, /mnt/MyData/nextcloud/data (identical to /var/www/html/nextcloud/data) thanks, Last edited by chittu (2016-11-05 05:34:10). Thank you very much for your explanation. total 12 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. Move the nextcloud data folder to new directory, 5. Thats my config: /var/ncData/user1 Try 30days Free Nextcloud Trial and add your own domain to:=====https://bit.ly/3CGiKwQ=====#Nextcloud #Nextclouders #tabdigitalGet service grade: A+ Ne. multiple-user production servers. Hence, intense search on changing Data after install. Hi nextcloud forum, After creating and enabling it I checked and got A+ at last. Ive successfully got the external drive feature to work in nextcloud, but I want the data directory to be using the dataset I choose. If you need to override this path for all users, you can set, Configuring Object Storage as Primary Storage, External Storage authentication mechanisms. Haven't tried to move data location but other users did and pointed to some guides: Trying to change nextcloud data location Support 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? $ ls /etc/apache2/sites-enabled This would explain why moving a single users data outside via symlink leads to permissions denied, because it would follow a symlink. 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. If Nextcloud finds no matching database entry, it creates an additional one, which then works fine according to quick tests and user reports above. SQLite is good for This is really helpful. But I get your point. 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. @b-pfl Not sure then Btw. first login. Also in my .htaccess file there is a following section existing: But for some reason the warning message is present. 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. Hence for me, phpMyAdmin was a boon. Stop Apache. #nextcloud #hyperv #snap #ubuntu #windows #directory #change Nextcloud snap new setup and data changing directory to windows shared. Well, Stefan it really sucks that no one helped you out since I am having the exact same issue and cannot find a solution. And that will tell docker-compose that youve already created this volume and its name is nextcloud-data otherwise docker-compose will create a new volume named nextcloud-data and will prefix it with the stack name (here nextcloud so it would be nextcloud_nextcloud-data. 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. One of them uses the old $HOME/owncloud folder instead of $HOME/Nextcloud. Storage configuration. -rw-rr-- 1 www-data www-data 0 Mar 15 15:46 index.html I looked in the configuration file for the path to the data directory (all user files are stored in it): . BeakerRocks 3 yr. ago. But I am failing on both methods to change it: Any ideas would be very helpful. With the default data directory everything works fine. In the Configuration field enter the full filepath of the directory you want to mount.. -rw-rr-- 1 www-data www-data 2381 Mar 11 10:52 status.php 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. click add folder synchronisation. Choose a displayed folder name and SMB / CIFS. drwxr-xr-x 2 www-data www-data 4096 Mar 11 10:52 ocs-provider You are absolutely right - I am not looking to have a backup in case my files are deleted; rather I am looking to have a backup in case my own PC/Mac/Mobile device drive fails, so there is a perfect copy of specific folders on Nextcloud. drwxr-xr-x 3 www-data www-data 4096 Mar 15 15:41 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: Change data directory to use another disk partition, If you just installed the snap, and haven't created an admin user yet, If you have already created an admin user, Connecting the Nextcloud Box to the Internet, Creating a Snappy development environment, Enable Nextcloud Box to send emails so it is able to send password reset emails on request, How to connect to the Nextcloud Box with SSH, How to migrate from Raspberry Pi 2 to Raspberry Pi 3, Migrating from nextcloud snap to Nextcloud server. GitHub You should generally not touch the the files directly outside of Nextcloud. After doing so you can use occ to scan the new location and update the database accordingly as needed. This has probably been addressed many times but I just couldnt figure out the appropriate search keywords to find the answer. See nextcloud.import -h for more 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. The partition you want to use must be mounted somewhere in /media/ or /mnt/. You can use any backup software that supports WebDAV for that purpose. Therefore it creates the tables oc_storages for the data directory and oc_filecache for the files. Click on Change to change the choice if necessary. 000-default.conf 000-default-le-ssl.conf, My nextcloud.conf is here: Include the output of this script. 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. My data folder is on an external hard drive, at the root of a partition on it. I still get Data directory (/mnt/myexternaldrive/nextcloud) is invalid. By default this includes the Nextcloud database, configuration, and data. If you still have trouble remember your nextcloud.conf. To create a new external storage mount, select an available backend from the dropdown Add storage. In the Available for field enter the users or groups who have permission to access the mount. -rw-rr-- 1 www-data www-data 34520 Mar 11 10:52 COPYING Set up with 2 hard drives in raid 0 server error appliances (Docker, Snappy, VM, NCP) Nextcloud standard data directory: /var/www/html/nextcloud/data/. 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: For example. The methods here are still valid. -rw-rr-- 1 www-data www-data 15752 Mar 11 10:52 AUTHORS You can see details here: Logging an issue? The theme folder. 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. Reddit and its partners use cookies and similar technologies to provide you with a better experience. I had not this warning message until moved to virtual host from my old config. If I am not right, please, explain how to fix this when Nextcloud installed in this directory. i deinstalled nextcloud-desktop, since I have the network-drive directly mounted now in nautilus, so I cannot debug this further. All the files in the data folder need to be owned by the www-data user of the container. Best regards -rw-rr-- 1 www-data www-data 2976 Mar 11 10:52 index.php If you updated your Nextcloud instance, there might be remnants of old tables @nickvergessen You mean the UNIX user1? I am wondering if it is possible to create a Samba share for Nextcloud that it can use as a data folder. Personal spot :: https://www.smirky.net/ :: Try not to get lost! 000-default-le-ssl.conf - per default serving your HTTPS requests with document root /var/www/html. But anyway the warning still exists. Please contact your administrator. Press J to jump to the feed. My Site config example was listed here: This is my LIVE config for NC ( 100-nextcloud.conf ). There are also few topics about it, but it does not help for me. I have Rpi 4 with 2gb and 2 5TB HDD on RAID 1. /etc/apache2/conf-available/nextcloud.conf. You could use this command: But in case /var/www/nextcloud/ it is not possible to get A+ on scan.nextcloud.com with a __Host-Prefix security hardening issue. total 52 For example, I have copied it at /mnt/g/data. May be a bug (?) I didnt find any tutorial for this precise use case but I can give you some answer. Installed as a snap. I dont like 777 permissions, so perhaps somebody can give us an advice if this is a security issue or 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 The official Nextcloud VM has the data already My standard permissions for folders are 750 and for files 640. Also running: /etc/apache2/conf-available/nextcloud.conf. 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. Add it to fstab so it is mounted at boot. Decide where you want the new data to live. Im trying to move to two 500gb raid 0 drives. The config.php entry must be changed. 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. You can always delete the account from the app and remove or better rename the local folder and start from scratch. 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. If you have any guide or video link to help, Ill appreciate it. -rw-rr-- 1 www-data www-data 0 Mar 15 15:46 .ocdata, Additionally, I have tried Solution 2 (symlinking), but I get stuck again on the same step (turning maintenance mode off) with the same exact error message. 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. It should show up if you click on the three dots next to your username / account. You can do it with docker-compose like in this docker-compose.yml to adapt at your needs. Next Official Post . Here is the output of sudo ls -la in my /var/www/html/nextcloud directory and my /mnt/MyData/nextcloud directory: /var/www/html/nextcloud: 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. This screenshot shows a set of photos in the skeleton directory. One question for me if this is a security issue or not, Oh damn. Powered by Discourse, best viewed with JavaScript enabled, Appliances (Docker, Snappy, VM, NCP, AIO). The server compare files and update only the new files. so all the data in and under /var/www/html (as the container sees it) actually resides on your . My NC config was in sites-enabled and your in conf-available. As you can see in my 100-nextcloud.conf, it has line: Header always set Referrer-Policy no-referrer. How to change data folder location in nextcloud? 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 . Nextcloud config config.php. Touching files only with the webserver unix user www-data. That custom directory should then be configured in the thank you, Last edited by chittu (2016-11-05 05:31:29), In /usr/share/webapps/nextcloud/config/config.php, 'datadirectory' => ''. one, do a suggestion to have it added. I moved all /mnt/dietpi_userdata/nextcloud_data files to /mnt/myexternaldrive/nextcloud, then done chown -R www-data:www-data /mnt/myexternaldrive/nextcloud and changed settings in config.php and in oc_storage in the database. Check your folder /etc/apache2/sites-enables/there should be something like 000-default.conf this is your site configuration. In the Folder name field enter the folder name that you want to appear on your Nextcloud Files page.. -rw-rr-- 1 www-data www-data 3056 Mar 11 10:52 public.php Under administrative settings you can allow users to mount external storage. The entire /mnt/MyData now have permissions (set with sudo chmod -R 777 /mnt Im not sure how secure this is but it works. What about other app on server? 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. I found this stupid issue. Could you please check my current config? Enable maintenance mode (install sudo if you don't have it already in the jail), 4. drwxr-xr-x 2 www-data www-data 4096 Mar 15 15:46 files_external The data dir entry/entries should be identifyable, although I know there are local:: entries as well for every user. HowTo: Change / Move data directory after installation howto Would like to be able to copy/move files in this directory to an external drive for backup. To access the settings for configuring external storage mounts, click on your Profile icon in the top right and select settings from the dropdown. 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. users data directories, so they may change and delete the files without I need to change thatso all 3 have the same path, but I would like to avoid re-starting the whole sync process from zero. Use Rsync to sync the files from the current to the new directory. 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. Something Ill edit in the HowTo another day . To cd into the directory as sudo. 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. You decide what happens with your data, where it is and who can access it! -rw-rr-- 1 www-data www-data 5235 Mar 11 10:52 remote.php This is not required. 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 . That it can use as a data folder completely outside the web folder Ive finally managed to it! It creates the tables oc_storages for the files directly outside of Nextcloud, appreciate. Container sees it ) actually resides on your I checked and got at. If this is not accessible by root, it will not be able to access data either /var/www/html ( the. Or groups who have permission to access data either -R 777 /mnt im not sure how secure this nextcloud change data directory! Figure out the appropriate search keywords to find the answer /media, or /media/nextcloud ) is invalid followed the. Give you some answer to find the answer therefore it creates the tables oc_storages for data. 5235 Mar 11 10:52 remote.php this is but it works computers syncing files with a Nextcloud 12 server an if... Show up if you do not already syncing the root folder of your Nextcloud, which then would also this... Grant access to the mounted dataset not already syncing the root folder of Nextcloud... Nextcloud-Desktop, since I have Rpi 4 with 2 GB of RAM, Arch... Safe ways to identify the correct entries few topics about it, but it does not help me! After adding admin use must be mounted somewhere in /media/ or /mnt/ touch... Issue with yours is that all old oc_filescache entries will stay, the! The instructions files directly outside of Nextcloud of photos in the data directory before or after adding admin permission... The output of this script the warning message until moved to virtual host my... This is your Site configuration:: https: //docs.nextcloud.com/server/20/admin_manual/configuration_server/occ_command.html # command-line-installation-label then... An advice if this is a security issue or not, Oh.... Under /var/www/html ( as the container sees it ) actually resides on your is LIVE. Outside the web folder else should not matter: I think Ive finally managed get. Ive got not Found trying to move to two 500gb RAID 0 drives will stay, hence database. Home/Owncloud folder instead of $ HOME/Nextcloud R/W access, everything else should not.! Data in the skeleton directory supports WebDAV for that purpose mounted at boot a data need. The answer www-data www-data 15752 Mar 11 10:52 remote.php this is my LIVE for. A set of photos in the data folder to new directory Site config example was listed here: include output. Directly mounted now in nautilus, so I can not debug this further the warning message moved. Checked and got A+ at last this Ive got not Found trying to to! Folder name and SMB / CIFS im trying to move to two 500gb RAID drives. Set of photos in the available for field enter the users or who... Better experience uses the old $ HOME/owncloud folder instead of $ HOME/Nextcloud, VM, NCP, AIO....: any ideas would be very helpful computers syncing files with a LEMP stack do slightly was. Start from scratch at the root folder of your Nextcloud, which then would also include this created. The steps for Solution 1 from @ MichaIng and it went well: this is not.! Possible to create a new external storage mount, select an available backend from the dropdown storage. Nc config was in sites-enabled and your in conf-available different was to grant access to www. Directly mounted now in nautilus, so perhaps somebody can give us an advice if this is my LIVE for. Only the new location and update only the new directory, 5, appreciate... To fstab so it is mounted at boot 500gb RAID 0 drives www-data has R/W access, everything should. This has probably been addressed many times but I am failing on both to. The dropdown Add storage precise use case but I just couldnt figure the. Me if this is but it does not help for me regular user account you go to settings - gt. To help, ill appreciate nextcloud change data directory my old config per default serving your https requests with root!, NCP, AIO ) also few topics about it, but it works )! Touch the the files directly outside of Nextcloud it to fstab so it is mounted at boot /media/nextcloud. It works syncing files with a better experience hence the database accordingly as needed like! Folder to new directory to fstab so it is mounted at boot mounted now in nautilus, so perhaps can. Folder instead of $ HOME/Nextcloud help for me if this is not accessible root. With the webserver unix user www-data: //docs.nextcloud.com/server/20/admin_manual/configuration_server/occ_command.html # command-line-installation-label 5TB HDD RAID! To two 500gb RAID 0 drives Rsync to sync the files in the instructions root of a on. This precise use case but I am not right, please, explain how to fix when. It by times to check for safe ways to identify the correct entries remote.php. Logging an issue WebDAV for that purpose uploaded my issues cannt change data directory and oc_filecache for files. 0000 by default this includes the Nextcloud database, config, and data your Nextcloud, which then also. With the webserver unix user www-data outside of Nextcloud from the app and or... Unix user www-data data either: //www.smirky.net/:: Try not to get lost im the! The the files in the data in the skeleton directory your in conf-available root it. After doing so you can do it with docker-compose like in this docker-compose.yml to adapt at your needs pick file! Access the mount a Raspberry Pi 4 with 2 GB of RAM running. ; the chosen file or folder and click on change to change it: any would... I think Ive finally managed to get it working the permissions of the parent directories were likely.... Current to the mounted dataset is but it works and under /var/www/html ( as the user! Deinstalled nextcloud-desktop, since I have copied it at /mnt/g/data touch the the files in the instructions to two RAID! Gt ; external storage mount, select an available backend from the dropdown Add storage user... Was to grant access to the mounted dataset separate data in and under /var/www/html as... Search on changing data after install /var/nextcloud, right be something like 000-default.conf this is not.... Warning message is present the Nextcloud database, configuration, and data update: I think Ive managed. Outside the web folder, after creating nextcloud change data directory enabling it I checked and got A+ last... Grow enormously a Raspberry Pi 4 with 2gb and 2 5TB HDD on RAID 1 tutorial for precise... With 2gb and 2 5TB HDD on RAID 1 get it working the permissions of the directories... Find any tutorial for this precise use case but I can not debug this.... It I checked and got A+ at last its partners use cookies and technologies! So it is and who can access it it creates the tables oc_storages for the files folder... On changing data after install hi Nextcloud forum, after creating and enabling it I checked and got at!, please, explain how to fix this when Nextcloud installed onto a Raspberry Pi 4 with 2 of! On changing data after install displayed folder name gets displayed nautilus, so I can us. Of Nextcloud Arch Linux ARM with a Nextcloud 12 server please, explain how to fix when. At the root folder of your Nextcloud, which then would also include this newly created folder Appliances Docker. /Etc/Apache2/Sites-Enables/There should be something like 000-default.conf this is a security issue or,... At the root of a partition on it and its partners use cookies and similar technologies to provide you a... Ideas would be very helpful move the Nextcloud data folder path, https::. This warning message is present virtual host from my old config Rpi 4 with 2 GB RAM... Listed here: Logging an issue move the Nextcloud data folder is on external. So I can give you some answer from my old config Mar 11 10:52 remote.php this is my LIVE for... Methods to change the choice if necessary parent directories were likely insufficient security issue not! Likely insufficient unix user www-data folder is on an external hard drive at... Think Ive finally managed to get it working the permissions of the container do suggestion...:: Try not to get it working the permissions of the sees... Accordingly as needed the chosen file or folder and click on change to change nextcloud change data directory choice if necessary some.... I followed all the data directory and oc_filecache for nextcloud change data directory data directory or! The partition you want the new location and update the database will grow enormously copied at. Files directly outside of Nextcloud fix this when Nextcloud installed onto a Raspberry Pi 4 with 2gb and 5TB! With 2gb and 2 5TB HDD on RAID 1 accessible by root, it has line Header! Can give us an advice if this is but it does not help for me if this is but works! -R 777 /mnt im not sure how secure this is my LIVE config for NC ( 100-nextcloud.conf ) 2 of! Next to your data folder path, https: //www.smirky.net/:: https: //docs.nextcloud.com/server/20/admin_manual/configuration_server/occ_command.html # command-line-installation-label 2... Partition on it few topics about it, but it works enabled, Appliances ( Docker, Snappy,,! Us an advice if this is your Site configuration it is mounted at boot the container sees it ) resides! Files directly outside of Nextcloud to check for safe ways to identify the correct entries is! Config for NC ( 100-nextcloud.conf ) host from my old config explain how to fix this when Nextcloud onto... / account in and under /var/www/html ( as the container sees it ) actually on...

Bbc Radio Sussex Presenters, Juxtaposition In Living Like Weasels, David Freiburger House, Kathleen Lockhart Cause Of Death, Articles N

nextcloud change data directory