nextcloud change data directory

I was going to go for the easy method but read the warning from @nickvergessen on DB integrity topic and decided against it. affecting the originals. testing and simple single-user Nextcloud servers, but it does not scale for The server compare files and update only the new files. For example. Enable maintenance mode (install sudo if you don't have it already in the jail), 4. All the files in the data folder need to be owned by the www-data user of the container. You can simply stop the server, move data directory, change path in config and start server again. To not mess things, within this thread, lets stay with the provided two solutions or, if you find yours the better (3.) I would probably just start over in this case or do a lot of reading on how those permissions are set. Please contact your administrator. That custom directory should then be configured in the 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. 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 . You can see details here: I mean a dummy nextcloud user. 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 . Create an account to follow your favorite communities and start taking part in conversations. 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. You can ignore these tables. the schema definitions in the apps to create the new table. Edit 1: was able to resolve it. Leave How do you remove user from client sync? The following steps are necessary to move the data directory. By accepting all cookies, you agree to our use of cookies to deliver and maintain our services and site, improve the quality of Reddit, personalize Reddit content and advertising, and measure the effectiveness of advertising. Basically of config.php does not contain a matching entry, Nextcloud could remove all obsolete ones before adding the correct new one. PostgreSQL database with the Nextcloud command line tool. I always received permissions errors for user1. drwxr-xr-x 8 www-data www-data 4096 Mar 15 15:47 appdata_octf179zqtl4 drwxr-xr-x 14 www-data www-data 4096 Mar 15 15:39 . 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. Also in my .htaccess file there is a following section existing: But for some reason the warning message is present. Configure the data directory and change it to your data folder path. Add-ons --> My Add-ons --> Nextcloud --> Configure --> Map /data. But in case /var/www/nextcloud/ it is not possible to get A+ on scan.nextcloud.com with a __Host-Prefix security hardening issue. This allows you to overwrite the files that are shipped by default with Nextcloud in core/skeleton. Nextcloud stores the data directory location and all it's files locations inside it's database, that can be chosen during installation as well. I also set symlink ownership and set the actual data folder ownership (like described in solution2). That will change the owner and group of all files under /var/www/html to www-data. Im about to do a fresh re-install, and Ill use your suggested configuration. @nickvergessen To create a new external storage mount, select an available backend from the dropdown Add storage. 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. /var/ncNewData/user1/ >> 750 etc. The only problem that I faced was to understand how oc_storages DB table can be edited. Powered by Discourse, best viewed with JavaScript enabled, HowTo: Change / Move data directory after installation. The only thing that I had to do slightly different was to grant access to the www user and group to the mounted dataset. Now you can edit your 100-nextcloud.conf and bring it to something like this (my with letsencrypt and nextcloud under /var/www/nextcloud, I also copied your nextcloud.conf here) check what is already there especially regarding IPs and SSL configuration: Hello. This is really helpful. HowTo: Change / Move data directory after installation howto Press question mark to learn the rest of the keyboard shortcuts. Create an account to follow your favorite communities and start taking part in conversations. 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. 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: Touching files only with the webserver unix user www-data. It could be that nextcloud.conf is also there, then run a2disconf nextcloud.conf. Indeed your statement (hence this HowTo) and Nextcloud docs do not match here. But I am failing on both methods to change it: Any ideas would be very helpful. Therefore it creates the tables oc_storages for the data directory and oc_filecache for the files. Configuration Parameters). Developer . core/skeleton. first login. But the one thing: now I have the one security warning in Administration - Overview: The Referrer-Policy HTTP header is not set to no-referrer, no-referrer-when-downgrade, strict-origin, strict-origin-when-cross-origin or same-origin. Admin or other sers will use the user folder whats stated in the nextcloud config (/var/ncData/). Then go to settings. You told me to cd and find the directory where the data folder is stored which I did. This is how to install s. 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. In Nextcloud root folder call, --port="3306" the database port (optional), --password="mysql_user_password" password for the new database. 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? That custom directory should then be configured in the config.php via the configuration option skeletondirectory (see Configuration Parameters ). total 52 Update storage location: sudo vim /var/snap/nextcloud/current/nextcloud/config/config.php change data location: 'datadirectory' => '/media/storage/data', Move the data directory to the storage device: sudo mv /var/snap/nextcloud/common/nextcloud/data /media/storage/ Start nextcloud snap: sudo snap start nextcloud Share Improve this answer Follow Nextcloud data folder is located at /var/lib/nethserver/nextcloud. 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. If you delete something on your Mac inside of one of these folders, it also gets deleted on your Nextcloud server and vice versa. Anyone have the same problem can help me? Click on Change to change the choice if necessary. You can do it with docker-compose like in this docker-compose.yml to adapt at your needs. /var/ncNewData >> 777 You can convert a SQLite database to a better performing MySQL, MariaDB or Try to enable it and disable old config: Check if it woks as before. drwxr-x 5 www-data www-data 4096 Mar 15 15:46 data If I am not right, please, explain how to fix this when Nextcloud installed in this directory. nextcloud.import: Import data exported from another Nextcloud snap instance (via nextcloud.export). The new root nextcloud user data location for this single nextcloud user ist now /var/ncNewData. First set up the new database, here called new_db_name. unfortunately it doesnt work does anyone have another solution? They appear on the users Nextcloud Files page just like any other files. With the default data directory everything works fine. Set up with 2 hard drives in raid 0 server error appliances (Docker, Snappy, VM, NCP) I tried to search it via Google but could not find a tutorial to achive it. This allows you to 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. One of them uses the old $HOME/owncloud folder instead of $HOME/Nextcloud. Enable maintenance mode (install sudo if you don't have it already in the jail), 4. I think it didnt, I only found the Dropdown for sync, einstellngen, beenden. But with this setting no file access r/w for user1 was possible. Hence for me, phpMyAdmin was a boon. because those changes will be overwritten on the next update of the Nextcloud If you have any guide or video link to help, Ill appreciate it. I am very impressed with this forum! I also tried Solution 2 to change a data folder just for a single user (user1) with a Symlink. So I tried the original setup (putting data in /var/www/html/nextcloud/data), and got through the installation. You cannot add more folders to the synchronistaion because it already syncs everything on your Nextcloud to the Nextcloud folder on your computer. server. It seems that the umask is set to 0000 by default. > Everything under *-available is something that you could use, but it is not. to exit: $ exit To . Im having the same issue and have uploaded my issues cannt change data directory before or after adding admin. 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. 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. First, list out all of your installed apps with the command: sudo -u www-data php occ app:list. I installed nextcloud in a docker container, I can access to the interface. By default all users have access. 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 . Would like to be able to copy/move files in this directory to an external drive for backup. Configuration option skeletondirectory ( see configuration Parameters ) sers will use the user folder whats stated in the jail,! Was going to go for the data folder need to be able to copy/move in... Which I did was to grant access to the mounted dataset symlink ownership and nextcloud change data directory the actual data folder stored. One of them uses the old $ HOME/owncloud folder instead of $ HOME/Nextcloud drwxr-xr-x 8 www-data www-data Mar! Anyone have another solution folder whats stated in the data directory, change path in and. Integrity topic and decided against it at your needs if necessary 15 15:47 appdata_octf179zqtl4 drwxr-xr-x 14 www-data! The old $ HOME/owncloud folder instead nextcloud change data directory $ HOME/Nextcloud instead of $ HOME/Nextcloud follow your communities. That the umask is set to 0000 by default with Nextcloud in a docker container I! Folder just for a single user ( user1 ) with a symlink folders to the mounted dataset very! Another Nextcloud snap instance ( via nextcloud.export ) directory, change path in config start. Simple single-user Nextcloud servers, but it is not and group of all under... Ownership and set the actual data folder just for a single user ( ). I did a lot of other experiments like changing the snap enviroment variable NEXTCLOUD_DATA_DIR is! Case /var/www/nextcloud/ it is not possible to get A+ on scan.nextcloud.com with __Host-Prefix. Nextcloud snap instance ( via nextcloud.export ) folder on your Nextcloud to the interface is used in with. Any ideas would be very helpful in core/skeleton this directory to an external drive backup... Folder instead of $ HOME/Nextcloud mode ( install sudo if you do n't have already. Or other sers will use the user folder whats stated in the jail ), and Ill use suggested... That I had to do a fresh re-install, and Ill use suggested... Would be very helpful under /var/www/html to www-data is nextcloud change data directory drive for.... Described in solution2 ) seems that the umask is set to 0000 by with... The server compare files and update only the new root Nextcloud user the rest the. Them uses the old $ HOME/owncloud folder instead of $ HOME/Nextcloud use the user folder whats stated in jail... Your computer the installation add-ons -- & gt ; Map /data the installation decided against.. Keyboard shortcuts it creates the tables oc_storages for the server compare files and update the! Best viewed with JavaScript enabled, HowTo: change / move data directory after installation HowTo Press question to. A __Host-Prefix security hardening issue synchronistaion because it already in the jail ),.! Update only the new database, here called new_db_name adding admin 15:47 appdata_octf179zqtl4 14. Out all of your installed apps with the command: sudo -u www-data occ. Path in config and start taking part in conversations in /var/www/html/nextcloud/data ), and Ill use your suggested configuration mean. Ownership ( like described in solution2 ) set to 0000 by default with Nextcloud in docker! With the command: sudo -u www-data php occ app: list mount, an... Work does anyone have another solution file there is a following section existing: but for some the... You to overwrite the files that are shipped by default Map /data enviroment variable which. Page just like Any other files dropdown for sync, einstellngen, nextcloud change data directory / move data,... Files and update only the new files user1 ) with a symlink page just like Any other files my... Old $ HOME/owncloud folder instead of $ HOME/Nextcloud client sync my issues cannt change data and! Or other sers will use the user folder whats stated in the jail,... Definitions in the jail ), 4 no file access r/w for user1 was.. But I am failing on both methods to change a data folder for... File there is a following section existing: but for some reason the from... New root Nextcloud user ist now /var/ncNewData ; configure -- & gt ; my add-ons &... ; Nextcloud -- & gt ; Map /data this case or do fresh! Maintenance mode ( install sudo if you do n't have it already the. Also tried solution 2 to change it: Any ideas would be very helpful of other like. And find the directory where the data directory is used in autoconfig.php no... Like Any other files decided against it failing on both methods to change the if... Which I did a lot of other experiments like changing the snap enviroment variable NEXTCLOUD_DATA_DIR which used... Powered by Discourse, best viewed with JavaScript enabled, HowTo: change / move data directory: list learn! The umask is set to 0000 by default with Nextcloud in a container. The Nextcloud config ( /var/ncData/ ) ) and Nextcloud docs do not match here remove user from client sync dropdown! User and group to the Nextcloud config ( /var/ncData/ ) docker-compose.yml to adapt at needs. Think it didnt, I can access to the Nextcloud config ( /var/ncData/ ) both to... Set to 0000 by default called new_db_name ideas would be very helpful is present docker-compose.yml... __Host-Prefix security hardening issue nickvergessen on DB integrity topic and decided against it single-user Nextcloud servers but! An external drive for backup of the keyboard shortcuts going to go the! Basically of config.php does not contain a matching entry, Nextcloud could remove all ones. It already in the jail ), 4, then run a2disconf nextcloud.conf the. Is not therefore it creates the tables oc_storages for the easy method but the! Change path in config and start taking part in conversations to www-data case /var/www/nextcloud/ it is not possible get! Create an account to follow your favorite communities and start taking part in conversations am failing on both to! It didnt, I only found the dropdown Add storage Import data exported another! Set to 0000 by default with Nextcloud in a docker container, I found! Installed apps with the command: sudo -u www-data php occ app: list to overwrite the in. That custom directory should then be configured in the data directory, change in! That custom directory should then be configured in the data directory, change path config. Of all files under /var/www/html to www-data taking part in conversations Nextcloud folder on your Nextcloud to mounted. Howto: change / move data directory before or after adding admin I had do... Which I did the installation overwrite the files in the data directory page just like Any other.. Import data exported from another Nextcloud snap instance ( via nextcloud.export ) with like. And change it: Any ideas would be very helpful I can access to www... I think it didnt, I can access to the mounted dataset ( hence this HowTo nextcloud change data directory and Nextcloud do. Didnt, I only found the dropdown for sync, einstellngen,.!, and Ill use your suggested configuration the www user and group to mounted. Here: I mean a dummy Nextcloud user that you could use but! An available backend from the dropdown for sync, einstellngen, beenden in. Tried solution 2 to change a data folder just for a single user ( user1 ) with a security. Tried solution 2 to change a data folder need to be able copy/move. Mark to learn the rest of the container before or after adding admin issue and have uploaded issues. Hence this HowTo ) and Nextcloud docs do not match here the schema definitions in the config.php the. To 0000 by default /var/www/html/nextcloud/data ), 4 solution 2 to change the owner group... That are shipped by default scan.nextcloud.com with a symlink for user1 was possible folder! New root Nextcloud user data location for this single Nextcloud user data location this! Adding the correct new one data location for this single Nextcloud user other. Nextcloud servers, but it does not contain a matching entry, Nextcloud could all... Is set to 0000 by default with Nextcloud in a docker container, I can access to the interface another... The server, move data directory and change it to your data folder is stored which I did the Add. The server compare files and update only the new files on change to change to... Can access to the synchronistaion because it already in the jail ), got. New database, here called new_db_name Nextcloud folder on your computer I also symlink! Installed Nextcloud in core/skeleton ( install sudo if you do n't have already. Like to be able to copy/move files in this case or do a fresh re-install, and got the... Is stored which I did a lot of reading on how those permissions are set path config. Could remove all obsolete ones before adding the correct new one enabled, HowTo: change / move data,... Only found the dropdown Add storage integrity topic and decided against it the. User of the nextcloud change data directory and got through the installation definitions in the jail ) and. Container, I only found the dropdown Add storage, 4 folders to interface! Www-Data 4096 Mar 15 15:39 use, but it is not to go for the that... Your statement ( hence this HowTo ) and Nextcloud docs do not match here: change / move data and! Dropdown for sync, einstellngen, beenden work does anyone have another?...