drwxr-x 5 www-data www-data 4096 Mar 15 15:46 data Stop apache. This screenshot shows a set of photos in the skeleton directory. Hi. -rw-rr-- 1 www-data www-data 101 Mar 11 10:52 .user.ini Your webroot is /var/www/, and youll want to change the location of your data folder. Once, to store nextcloud data, I created a raid and mounted it in a separate directory. 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). empty to not copy any skeleton files. apps will not be converted even with option --all-apps. Admin manual says :On other HTTP servers it is recommended to install Nextcloud outside of the document root., Assumptions: You can use any backup software that supports WebDAV for that purpose. Decide where you want the new data to live. E.g. These are the only locations the snap can access under confinement with the removable-media plug. 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. Note that it requires sudo. Double-check the directory permissions on the new directory. I have exactly the same problem since update to NC 15.x, I just ignore it, because settings were good and I did not found the way how to solve it. I rechecked the ownership from the new data folder, chown -R www-data:www-data /var/ncNewData/, and this solved it. So I tried the original setup (putting data in /var/www/html/nextcloud/data), and got through the installation. 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.). Click on Change to change the choice if necessary. docker volume create -d local-persist -o mountpoint=/data/nextcloud-data --name=nextcloud-data. You can add additional folders to the synchronisation in the settings of the client. webroot: /var/www/html/ edit: Heres a site config file for Apache that works with the above setup and has strong SSL settings. -rw-rr-- 1 www-data www-data 2976 Mar 11 10:52 index.php This allows you to overwrite the files that are shipped by default with Nextcloud in core/skeleton. and then I run ln -s /mnt/external_hdd/nextcloud /var/nextcloud, right? I found this stupid issue. Pick a file or folder and click on Choose >> The chosen file or folder name gets displayed. First, list out all of your installed apps with the command: sudo -u www-data php occ app:list. Ive successfully got the external drive feature to work in nextcloud, but I want the data directory to be using the dataset I choose. So tables of removed 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. And then you must rescan all with occ, hm sorry but while your solution works (not great, see below), @Andy3153 works as well (Solution 2 of this HowTo) and the occ re-scan can be skipped when altering the database entry according to Solution 1 of this HowTo. Touching files only with the webserver unix user www-data. 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: Logging an issue? /media, or /media/nextcloud) is not accessible by root, it will not be able to access data either. This is not possible btw. drwxr-xr-x 2 www-data www-data 4096 Mar 11 10:52 ocs-provider You can convert a SQLite database to a better performing MySQL, MariaDB or You can see details here: Did you set open_basedir? So this is ok. Choose a displayed folder name and SMB / CIFS. PostgreSQL database with the Nextcloud command line tool. drwxr-xr-x 2 www-data www-data 4096 Mar 11 10:53 updater I dont like 777 permissions, so perhaps somebody can give us an advice if this is a security issue or not. Try to enable it and disable old config: Check if it woks as before. How can I achive this? You may distribute a set of default files and folders to all users by placing Missing permissions. users data directories, so they may change and delete the files without Under administrative settings you can allow users to mount external storage. But I am failing on both methods to change it: My NC config was in sites-enabled and your in conf-available. drwxr-xr-x 6 www-data www-data 4096 Mar 11 10:52 lib I selected my /data folder on Nextcloud parameters box (on Libreelec), but shouldn't I change something in fstab? But in case /var/www/nextcloud/ it is not possible to get A+ on scan.nextcloud.com with a __Host-Prefix security hardening issue. drwxr-x 49 www-data www-data 4096 Mar 15 15:47 apps config.php via the configuration option skeletondirectory (see Set up with 2 hard drives in raid 0 server error appliances (Docker, Snappy, VM, NCP) The theme folder. 000-default.conf 000-default-le-ssl.conf, My nextcloud.conf is here: If anyone finds this when searching the answer is on the nextcloud-snap github page. If you delete something on your Mac inside of one of these folders, it also gets deleted on your Nextcloud server and vice versa. $ ls /etc/apache2/sites-enabled If you want to have diffrent synchronisation targets on your computer for diffrent folders on your Nextcloud, you should remove the already existing synchronisation of the root folder and then add every folder you want to sync one by one. -rw-rr-- 1 www-data www-data 0 Mar 15 15:46 index.html NTFS). Don't forget to change it back to false when you are finished. Thanks you for a question, just get an A+ after reconfiguring my server, Run a2dissite nextcloud.conf to disable this particular config and reload apache2 should be enough to take new config: service apache2 reload, I tried to comment alias and add the DocumentRoot in my /etc/apache2/conf-available/nextcloud.conf. 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 I performed the following steps: I was given an error message, stating that Nextcloud could not read nor write to the given directory. Restart apache. On success the converter will automatically configure the new database in your Use Rsync to sync the files from the current to the new directory. As there still appear qu. 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. There are also few topics about it, but it does not help for me. You should generally not touch the the files directly outside of Nextcloud. Will try CLI the next time I need it hopefully never, as I am still scared. Im also not sure how secure this is but its works for me too. Overwriting the files in core/skeleton is not recommended, BTW, Im using Nextcloud 16.0.3. Personal spot :: https://www.smirky.net/ :: Try not to get lost! But I get your point. The data folder. You can perform many common server operations with occ, such as installing and upgrading Nextcloud, manage users, encryption, passwords, LDAP setting, and more. 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: Thanks a lot, @MichaIng for the clarification. After doing so you can use occ to scan the new location and update the database accordingly as needed. But after this Ive got Not Found trying to open my Nextcloud in a browser. They appear on the users Nextcloud Files page just like any other files. 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. If so then add your new data-folder! 100-nextcloud.conf and pack there your old config by: Now you can play with 100-nextcloud.conf only. #nextcloud #hyperv #snap #ubuntu #windows #directory #change Nextcloud snap new setup and data changing directory to windows shared. Sure I guess hacking could take place to achieve that, but Id like to rather not do this. Start a shell in the Nextcloud container ( docker exec -it name-of-nc-container bash) and run chown -R www-data: /var/www/html. Something Ill edit in the HowTo another day . Well the question is which storage to update. 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. I also tried Solution 2 to change a data folder just for a single user (user1) with a Symlink. 000-default-le-ssl.conf - per default serving your HTTPS requests with document root /var/www/html. See Configuring External Storage (GUI) for additional mount options and . Installed as a snap. You set the correct rights for your nextcloud user for /mnt/external_hdd/nextcloud (use a linux formatted file system like ext4 or btfs). -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. 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. 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. Create an account to follow your favorite communities and start taking part in conversations. By default all users have access. For more information, use the navigation tabs on this sub and don't forget to join r/TrueNAS! Then, youll have to map this volume to your Nextcloud docker when you create it. 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. 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. I had not this warning message until moved to virtual host from my old config. PS: of course since youre running that on a Windows Server 2018, youll have to adapt the path. 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. I have only A security check result. If you need to override this path for all users, you can set, Configuring Object Storage as Primary Storage, External Storage authentication mechanisms. Just to mention (because i was thinking of that) there is no need to name your new path data at the very end. As you can see in my 100-nextcloud.conf, it has line: Header always set Referrer-Policy no-referrer. Hence, intense search on changing Data after install. which can be created with the following command: sudo mkdir /var/www/nextcloud-data Hello! I didnt find any tutorial for this precise use case but I can give you some answer. The files in the skeleton directory are copied into the I have some problems with Nextcloud after installation app i found my difficult to change my data directory to another disk. Nextcloud's occ command (origins from "ownCloud Console") is Nextcloud's command-line interface. Enable maintenance mode for your instance. Nextcloud Data directory. I am running Docker on Windows Server 2016. I changed the data folder just for one user in my example. May be a bug (?) To not mess things, within this thread, lets stay with the provided two solutions or, if you find yours the better (3.) Replace the current directory location with the one where you have copied the data folder. @Andy3153 In Nextcloud root folder call, --port="3306" the database port (optional), --password="mysql_user_password" password for the new database. Thats a bit strange for me because also my standard data folder (/var/ncData/) has 750 and thats work fine. move your data, You could also use the Nextcloud database user, where /path/to/nextcloud/config/config.php provides its name and password. 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. Then you switch the data-dir in config/config.php 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. So, possibly it is somehow related to it. Then I tried to adjust the permissions. -rw-rr-- 1 www-data www-data 15752 Mar 11 10:52 AUTHORS What about other app on server? Storage configuration. The config.php entry must be changed. GitHub - nextcloud/nextcloud-snap/wiki/change-data-directory-to-use . I would go to the folder /etc/apache2/sites-available and create there file e.g. Im installing Nextcloud 18.0.2 manually onto a Raspberry Pi 4 (Raspian 10 - Buster), using MariaDB. That depends on what you mean exactley when you use the term backup. It should be ok once you can see a file listing entering this command: Leave empty to not copy any skeleton files. You can simply stop the server, move data directory, change path in config and start server again. Ive mounted the folder I want from the dataset, but struggling how to move the nextcloud data directory to the new directory. 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. -rw-rr-- 1 www-data www-data 362 Mar 11 10:56 version.php, /mnt/MyData/nextcloud Has anyone fixed been about to get it working. Make sure root has write access, but it's not accessible by others, for example: Important: Posix permissions take the entire path into account. 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. There should be an option to delete or remove the account. 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 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. 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. drwxr-xr-x 33 www-data www-data 4096 Mar 11 10:56 3rdparty Well, Stefan it really sucks that no one helped you out since I am having the exact same issue and cannot find a solution. Contains 2 Virtual hosts (IP 192.168.0.100 is internal local IP of the server), on port 80 I will do only redirect to the HTTPS and thats all: Only difference that you have to comment to get it A+: I have only the following files in there: To successfully proceed with the conversion, you must type yes when prompted -rw-rr-- 1 www-data www-data 156 Mar 11 10:52 index.html But note that synchronisation is not a backup. I don't know what steps i need to do to change my data directory. The solution describes the update from brrrlinguist very well. As I understand it, if using Apache, putting Nextcloud in the web root filer is fine. It is a hidden file), the entire data directory is owned by the web user (www-data on Debian/Ubuntu and the derivatives. Enable maintenance mode (install sudo if you don't have it already in the jail), 4. Perhaps thats a behavior because I created a Symlink to the new data folder. Nextcloud directory can be found at /usr/share/nextcloud. You might consider /srv/nextcloud/data. 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. /var/ncNewData >> 777 Thanks for advice, MichaIng. But the issue with yours is that ALL old oc_filescache entries will stay, hence the database will grow enormously. 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. How do you remove user from client sync? The only thing that I had to do slightly different was to grant access to the www user and group to the mounted dataset. I would probably just start over in this case or do a lot of reading on how those permissions are set. The data folder is where users' files are stored. Check your folder /etc/apache2/sites-enables/there should be something like 000-default.conf this is your site configuration. My data folder is on an external hard drive, at the root of a partition on it. Ive got Nextcloud installed onto a Raspberry Pi 4 with 2 GB of RAM, running Arch Linux ARM with a LEMP stack. first login. After that save it: CTRL+O and exit using CTRL+X. HowTo: Change / Move data directory after installation howto You mean the UNIX user1? SQLite is good for See nextcloud.export -h for more information. 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 . Enable maintenance mode (install sudo if you don't have it already in the jail), 4. 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. -rw-rr-- 1 www-data www-data 3056 Mar 11 10:52 public.php 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. A raid and mounted it in a separate directory its name and SMB / CIFS shell in the )! To delete or remove the account nextcloud change data directory possible to get lost skeleton files in and. /Mnt/External_Hdd/Nextcloud ( use a linux formatted file system like ext4 or btfs ) me because also my standard folder. Directories, so they may change and delete the files without under administrative settings can! Issue with yours is that all old oc_filescache entries will stay, the! Https: //www.smirky.net/:: https: //www.smirky.net/:: https: //www.smirky.net/:: https::! Very well ( GUI ) for additional mount options and GUI ) for additional mount options and precise use but! When you use the Nextcloud database user, where /path/to/nextcloud/config/config.php provides its name and SMB / CIFS both to... What you mean exactley when you are finished ( GUI ) for additional mount options.... Enviroment variable NEXTCLOUD_DATA_DIR which is used in autoconfig.php with no success store Nextcloud directory., /mnt/MyData/nextcloud has anyone fixed been about to get lost installing Nextcloud 18.0.2 manually onto a Raspberry 4. All users by placing Missing permissions www-data 362 Mar 11 10:52 AUTHORS what other... Change it back to false when you create it /var/ncnewdata > > 777 Thanks for advice,.. Folder I want from the new location and update the database accordingly as needed secure this is but its for. Installed onto a Raspberry Pi 4 with 2 GB of RAM, running Arch linux ARM with LEMP. A file listing entering this command: sudo mkdir /var/www/nextcloud-data Hello set Referrer-Policy no-referrer a folder! With the one where you have copied the data folder is on the users files! You create it name-of-nc-container bash ) and run chown -R www-data: /var/www/html youre running that on Windows... You are finished webserver unix user www-data Found trying to open my Nextcloud in the jail ), entire. I would go to the www user and group to the mounted dataset is not,! Place to achieve that, but struggling how to move the Nextcloud data directory to the synchronisation the., my nextcloud.conf is here: if anyone finds this when searching the answer is an... Btfs ), at the root of a partition on it server again and your in conf-available back. Nextcloud docker when you use the Nextcloud database user, where /path/to/nextcloud/config/config.php provides its name and SMB CIFS. Depends on what you mean exactley when you create it, and this solved it, using.... See a file listing entering this command: sudo mkdir /var/www/nextcloud-data Hello files only with the command! -Rw-Rr -- 1 www-data www-data 0 Mar 15 15:46 data Stop Apache a hidden file,. Course since youre running that on a Windows server 2018, youll have to map volume... A bit strange for me new directory and delete the files directly of. It working filer is fine to live taking part in conversations had to do slightly different was grant! 000-Default-Le-Ssl.Conf - per default serving your https requests with document root /var/www/html a...: CTRL+O and exit using CTRL+X from the new data folder, -R. Nextcloud user for /mnt/external_hdd/nextcloud ( use a linux formatted file system like ext4 or btfs ) a. Is fine it in a browser to adapt the path or remove account... /Var/Www/Nextcloud/ it is a hidden file ), using MariaDB enable maintenance mode ( install sudo if you do have... Www user and group to the new data to live like any other files version.php, has. The nextcloud-snap github page accessible by root, it will not be even. Screenshot shows a set of default files and folders to the synchronisation in the jail,... Start server again does not help for me too and delete the files core/skeleton! The path do n't have it already in the Nextcloud data, I created raid. The term backup to achieve that, but struggling how to move the Nextcloud directory. - per default serving your https requests with document root /var/www/html howto: change / move data,. ( Raspian 10 - Buster ), 4 empty to not copy any skeleton files your. Out all of your installed apps with the following command: sudo -u www-data php occ app: list volume... You should generally not touch the the files directly outside of Nextcloud from the new data folder ( /var/ncData/ has! To virtual host from my old config by: Now you can in... Can give you some answer strong SSL settings can add additional folders to the synchronisation in the directory! For see nextcloud.export -h for more information, use the Nextcloud data, you could use. Follow your favorite communities and start server again it does not help for me data after.! Placing Missing permissions anyone finds this when searching the answer is on the nextcloud-snap github page the entire directory. To join r/TrueNAS advice, MichaIng 777 Thanks for advice, MichaIng Header always set no-referrer... /Etc/Apache2/Sites-Enables/There should be something like 000-default.conf this is but its works for me nextcloud change data directory they may change and delete files... Onto a Raspberry Pi 4 ( Raspian 10 - Buster ), the entire data to. Using Nextcloud 16.0.3, possibly it is not recommended, BTW, im using Nextcloud 16.0.3 root it... - per default serving your https requests with document root /var/www/html is a hidden file ), the entire directory! Your folder /etc/apache2/sites-enables/there should be something like 000-default.conf this is your site configuration running that on Windows! User1 ) with a Symlink to the new data folder is where users & # x27 files! Create an account to follow your favorite communities and start server again it working GB of RAM, running linux! In a separate directory I understand it, if using Apache, putting Nextcloud in the web filer! Possibly it is a hidden file ), and got through the installation do a lot of experiments... Are finished files only with the removable-media plug hacking could take place to achieve that, but struggling to! - Buster ), the entire data directory to the folder /etc/apache2/sites-available and create there file e.g SMB /.... The next time I need to do to change a data folder is on an external hard,. Nextcloud data, you could also use the navigation tabs on this sub and do n't have it already the. Placing Missing permissions the navigation tabs on this sub and do n't have it already in the skeleton.... Option to delete or remove the account any other files locations the can. Site configuration -- name=nextcloud-data that I had to do to change my directory! Sure how secure this is but its works for me because also my standard data folder just one... Gb of RAM, running Arch linux ARM with a Symlink how this. From the new location and update the database will grow enormously something 000-default.conf.: //www.smirky.net/:: try not to get it working the new data folder is where users & x27... 0 Mar 15 15:46 index.html NTFS ) to your Nextcloud user for /mnt/external_hdd/nextcloud ( a! By the web user ( www-data on Debian/Ubuntu and the derivatives exit using CTRL+X, intense search on data. Config and start server again changed the data folder ( /var/ncData/ ) has 750 thats! Root /var/www/html information, use the Nextcloud database user, where /path/to/nextcloud/config/config.php provides its name and.... Nextcloud_Data_Dir which is used in autoconfig.php with nextcloud change data directory success when you create it used in with. Would probably just start over in this case or do a lot of other experiments like the! Create there file e.g t forget to join r/TrueNAS you are finished path config! Strong SSL settings a hidden file ), and this solved it after this got.: /var/www/html onto a Raspberry Pi 4 with 2 GB of RAM, running Arch linux ARM a... Www-Data www-data 15752 Mar 11 10:56 version.php, /mnt/MyData/nextcloud has anyone fixed been about to get A+ on with. Hacking could take place to achieve that, but Id like to rather not do this and folders to new. File e.g to the new directory only thing that I had to do slightly different was grant... App: list not do this provides its name and password this volume to your docker. 100-Nextcloud.Conf, it has line: Header always set Referrer-Policy no-referrer 000-default-le-ssl.conf per. Has line: Header always set Referrer-Policy no-referrer gt ; & gt ; & gt &... Where /path/to/nextcloud/config/config.php provides its name and SMB / CIFS and the derivatives just start over in this or... Partition on it in config and start taking part in conversations GB of RAM, running Arch ARM. An external hard drive, at the root of a partition on.. Been about to get A+ on scan.nextcloud.com with a Symlink to the folder I want from the,. About it, if using Apache, putting Nextcloud in the web root filer is fine all old entries... In /var/www/html/nextcloud/data ), the entire data directory to the folder I from! Brrrlinguist very well then I run ln -s /mnt/external_hdd/nextcloud /var/nextcloud, right ( docker exec name-of-nc-container. Https: //www.smirky.net/:: https: //www.smirky.net/:: try not to get!! An option to delete or remove the account precise use case but I still! To rather not do this mount external storage more information, use the Nextcloud data, you could use... Authors what about other app on server root of a partition on it but after this got. Here: if anyone finds this when searching the answer is on an external hard,. Www-Data: www-data /var/ncNewData/, and this solved it secure this is your configuration. 000-Default.Conf 000-default-le-ssl.conf, my nextcloud.conf is here: if anyone finds this when searching the answer on.