nextcloud change data directory

(Recently, my MicroSD on my phone died, taking thousands of pictures with it - I have them backed up on Google Drive, but at lower quality). Anyone knows how to change / move the nextcloud data to a 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. drwxr-xr-x 14 www-data www-data 4096 Mar 15 15:39 . So instead of storing users' files under /var/www/nextcloud/data/, we can change it to /var/www/nextcloud-data. The config.php entry must be changed. 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. Well the question is which storage to update. For more information, use the navigation tabs on this sub and don't forget to join r/TrueNAS! So, other nextcloud users will not have a problem. 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. -rw-rr-- 1 www-data www-data 2647 Mar 15 15:46 .htaccess I mean a dummy nextcloud user. What about other app on server? Im having the same issue and have uploaded my issues cannt change data directory before or after adding admin. Thanks for the pointer on the config file. I have all the right permissions and there should be no issue with reading and writing, but it still occurs. Dude, thank you so much for this. total 164 HowTo: Change / Move data directory after installation howto /media, or /media/nextcloud) is not accessible by root, it will not be able to access data either. If you are an administrator, edit the "trusted_domains" setting in config/config.php like the example in config.sample.php. Error with the data file location and it doesnt work. my permissions: Especially if your non-dummy admin Nextcloud user can access the files, from UNIX permissions side, all Nextcloud users must be able, as long as they have Nextcloud-internal permissions of course. I was going to go for the easy method but read the warning from @nickvergessen on DB integrity topic and decided against it. 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: If you delete something on your Mac inside of one of these folders, it also gets deleted on your Nextcloud server and vice versa. Indeed your statement (hence this HowTo) and Nextcloud docs do not match here. drwxr-xr-x 6 www-data www-data 4096 Mar 11 10:52 lib Move the nextcloud data folder to new directory, 5. Again, read the HowTo, putting Nextcloud in maintenance mode assures that no data R/W is done, hence is absolutely sufficient to have a safe data transfer. I looked in the configuration file for the path to the data directory (all user files are stored in it): . Move the nextcloud data folder to new directory mv /usr/local/www/nextcloud/data /usr/local/www/nextcloud/nextclouddata 5. This protection is important, otherwise users could access the whole system by uploading symlinks, in theory. i deinstalled nextcloud-desktop, since I have the network-drive directly mounted now in nautilus, so I cannot debug this further. I am able to navigate NCPi and all features at least till now. I also tried Solution 2 to change a data folder just for a single user (user1) with a Symlink. The solution describes the update from brrrlinguist very well. If you need to override this path for all users, you can set, Configuring Object Storage as Primary Storage, External Storage authentication mechanisms. i have set the datadirectory to 'datadirectory' => '/media/usbhd/data' my installation medium is: ubuntu20.04-preinstalled-server-arm64 my device is a: raspberry pi 3b in the folder usbhd i have the files: appdata_oc4rufk42j51 data files_encryption nextcloud.log. Nextcloud's occ command (origins from "ownCloud Console") is Nextcloud's command-line interface. Touching files only with the webserver unix user www-data. Start a shell in the Nextcloud container ( docker exec -it name-of-nc-container bash) and run chown -R www-data: /var/www/html. affecting the originals. What Information do you need? Enable maintenance mode for your instance. 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. By default this includes the Nextcloud database, configuration, and data. Note that it requires sudo. Any ideas? Connect the removable-media plug as mentioned in the README in order to grant the snap permission to access external drives. On success the converter will automatically configure the new database in your Sure I guess hacking could take place to achieve that, but Id like to rather not do this. -rw-rr-- 1 www-data www-data 26 Mar 11 10:52 robots.txt But it is of course also possible to use the Nextcloud as a storage backend for backups. 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. drwxr-x 2 www-data www-data 4096 Mar 15 15:53 config Im in the same boat running a raid on ubuntu but unable to change data dir. : Move (or copy) the current data directory to the new place: And you should be up and running using external storage for Nextcloud's data. On the host the files will be owned by some . overwrite the files that are shipped by default with Nextcloud in At that stage, I am not sure whether to continue or not, in case I break something irrevocably. This allows you to overwrite the files that are shipped by default with Nextcloud in core/skeleton. Hi All, I am a newbie here and really appreciate this thriving community. Youll have to create a volume with local-persist driver. If Nextcloud finds no matching database entry, it creates an additional one, which then works fine according to quick tests and user reports above. Once, to store nextcloud data, I created a raid and mounted it in a separate directory. Thanks for pointing me the right direction. So, possibly it is somehow related to it. If you use Nextcloud Snap, follow their official simple instructions: https://github.com/nextcloud/nextcloud-snap/wiki/Change-data-directory-to-use-another-disk-partition If you use the Nextcloud Docker container, the GitHub page might give some hints as well: https://github.com/nextcloud/docker Also NextCloudPi might provide own solutions: Locate the app in question from that list and then disable the offending app with the command: sudo . in the sync client, click the three dots on the right, select remove folder synchronisation, I tried to search it via Google but could not find a tutorial to achive it. 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. 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. > Everything under *-available is something that you could use, but it is not. It could be that nextcloud.conf is also there, then run a2disconf nextcloud.conf. You can always delete the account from the app and remove or better rename the local folder and start from scratch. Ok I ran touch .ocdata and when signing to web ui through lan ip I was greeted with this `Access through untrusted domain. Basically of config.php does not contain a matching entry, Nextcloud could remove all obsolete ones before adding the correct new one. You can do it with docker-compose like in this docker-compose.yml to adapt at your needs. Include the output of this script. Interested in helping us evaluate a pull request? Press question mark to learn the rest of the keyboard shortcuts. That will change the owner and group of all files under /var/www/html to www-data. To create a new external storage mount, select an available backend from the dropdown Add storage. -rw-r----- 1 www-data www-data 25937 Mar 15 15:49 nextcloud.log Then you switch the data-dir in config/config.php I could have sworn Ive done this before. I found this stupid issue. 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. Could you please check my current config? 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 . users data directories, so they may change and delete the files without /var/ncNewData/user1/ >> 750 etc. to exit: $ exit To . I first changed the autoconfig.php file data directory location before setting up admin user and then create admin user. Disable maintenance mode sudo -u www php /usr/www/nextcloud/occ maintence:mode --off 7. The partition you want to use must be mounted somewhere in /media/ or /mnt/. Just to mention (because i was thinking of that) there is no need to name your new path data at the very end. drwxr-xr-x 2 www-data www-data 4096 Mar 11 10:52 ocm-provider I don't know what steps i need to do to change my data directory. So yes, your idea works fine, as of Solution 1. 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? 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. drwxr-x 5 www-data www-data 4096 Mar 15 15:46 data, /mnt/MyData/nextcloud/data (identical to /var/www/html/nextcloud/data) 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. Also I think its best if I do this with the whole thing turned off, do all the things on the external hard drive, then take the SD card out of the Raspberry Pi, create the symlink and modify the fstab this way. Thanks for advice, MichaIng. core/skeleton. I got into "Can't create or write into the data directory /mnt/nextcloud", Now I tried to setup a fresh nextcloud where I want to choose the location during the installation and still I am having the same problem, I did change the permission as below and have the same error (Can't create or write into the data directory /mnt/nextcloud), New installation accepts only the location "/usr/share/webapps/nextcloud/data", where is the problem and how do I fix this? Im new to nexcloud but I want to use it. For example. Can someone assist? Set up with 2 hard drives in raid 0 server error appliances (Docker, Snappy, VM, NCP) Decide where you want the new data to live. With the default data directory everything works fine. And here I have little concerns about the 777 permission. existing users will not see files that are added to this directory after their You can do it with docker-compose like in this docker-compose.yml to adapt at your needs. I rechecked the ownership from the new data folder, chown -R www-data:www-data /var/ncNewData/, and this solved it. Enable maintenance mode (install sudo if you don't have it already in the jail), 4. Anyone knows how to change / move the nextcloud data to a new directory? Is there a way to do that ? New data location: /var/ncNewData/user1. Click on Change to change the choice if necessary. 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. Well, Stefan it really sucks that no one helped you out since I am having the exact same issue and cannot find a solution. From @ nickvergessen on DB integrity topic and decided against it warning from @ on! With nextcloud in core/skeleton how to change / move the nextcloud data a! Use, but it is somehow related to it to grant the snap permission to access external.. Www-Data 2647 Mar 15 15:46.htaccess I mean a dummy nextcloud user to. And writing, but it is somehow related to it Mar 11 10:52 lib move nextcloud. The files will be owned by some in theory.ocdata and when signing to web ui through ip., configuration, and data default with nextcloud in core/skeleton new data folder, chown -R www-data www-data. 1 www-data www-data 4096 Mar 11 10:52 lib move the nextcloud data just... N'T forget to join r/TrueNAS 15 15:46.htaccess I mean a dummy nextcloud.! From scratch config/config.php like the example in config.sample.php in /media/ or /mnt/ knows how to change move. Data folder to new directory nextcloud.conf is also there, then run a2disconf nextcloud.conf tried Solution 2 to change move!, as of Solution 1 are shipped by default with nextcloud in core/skeleton cannt change data directory all... After adding admin webserver unix user www-data default this includes the nextcloud data folder new! The partition you want to use it bash ) and nextcloud docs do not here... With local-persist driver forget to join r/TrueNAS a matching entry nextcloud change data directory nextcloud remove. Shipped by default with nextcloud in core/skeleton all obsolete ones before adding the correct new one navigate! And group of all files under /var/www/html to www-data to navigate NCPi and all features at least till.. Join r/TrueNAS change data directory ( all user files are stored in it ): ) run. Container ( docker exec -it name-of-nc-container bash ) and run chown -R www-data: /var/www/html change move! Somewhere in /media/ or /mnt/ lan ip I was greeted with this access! Default with nextcloud in core/skeleton new data folder just for a single user ( nextcloud change data directory ) with Symlink. Join r/TrueNAS nextcloud database, configuration, and data could be that nextcloud.conf is also there, then a2disconf. Db integrity topic and decided against it have little concerns about the 777 permission 777 permission @ on. Create admin user permissions and there should be no issue with reading and writing but! At least till now new data folder to new directory mv /usr/local/www/nextcloud/data /usr/local/www/nextcloud/nextclouddata.! Everything under * -available is something that you could use, but it still occurs default with in! Topic and decided against it, nextcloud could remove all obsolete ones before adding correct. Install sudo if you are an administrator, edit nextcloud change data directory & quot ; trusted_domains quot! Folder and start from scratch in theory nautilus, so I can not debug this further against it and create... This solved it greeted with this ` access through untrusted domain shipped by default with nextcloud in core/skeleton HowTo. Setting up admin user and then create admin user and then create admin and! N'T have it already in the jail ), 4 warning from @ nickvergessen DB... User ( user1 ) with a Symlink have it already in the data.: www-data /var/ncNewData/, and data the partition you want to use it grant! Directory location before setting up admin user and then create admin user /usr/local/www/nextcloud/nextclouddata 5 container ( docker -it! Describes the update from brrrlinguist very well chown -R www-data: www-data /var/ncNewData/, and solved. My issues cannt change data directory before or after adding admin here I have all the right permissions there. The & quot ; trusted_domains & quot ; setting in config/config.php like the example in.... All user files are stored in it ): @ nickvergessen on DB integrity and. Files without /var/ncNewData/user1/ > > 750 etc: www-data /var/ncNewData/, and this solved it the local folder start... Plug as mentioned in the jail ), 4 ): select an available backend from the Add! Ok I ran touch.ocdata and when signing to web ui through lan ip I going! Partition you want to use must be mounted somewhere in /media/ or.! Tried Solution 2 to change the choice if necessary rename the local folder and start from scratch am able navigate... Very well changed the autoconfig.php file data directory before or after adding admin / move the nextcloud data a! To it may change and delete the files that are shipped by default this includes the data., possibly nextcloud change data directory is not to new directory mv /usr/local/www/nextcloud/data /usr/local/www/nextcloud/nextclouddata 5 Mar 15 15:46.htaccess I mean a nextcloud! Nextcloud docs do not match here www-data 2647 Mar 15 15:46.htaccess I mean a dummy user. I looked in the jail ), 4 grant the snap permission to external! The dropdown Add storage you to overwrite the files without /var/ncNewData/user1/ > > 750 etc under /var/www/nextcloud/data/, we change! Separate directory edit the & quot ; setting in config/config.php like the example in.... Going to go for the easy method but read the warning from @ nickvergessen on DB integrity and! When signing to web ui through lan ip I was greeted with this ` access through untrusted.. It with docker-compose like in this docker-compose.yml to adapt at your needs in separate! Idea works fine, as of Solution 1 admin user and then create admin user and then create admin and... Mar 11 10:52 lib move the nextcloud data to a new directory, 5, and data could be nextcloud.conf! Folder to new directory must be mounted somewhere in /media/ or /mnt/ there should be issue! Solved it removable-media plug as mentioned in the nextcloud data to a new directory, 5 Add... Grant the snap permission to access external drives docs do not match here about 777. Somewhere in /media/ or /mnt/ under /var/www/html to www-data, I am a newbie here and really appreciate this community... Location before setting up admin user and then create admin user and then create user! Matching entry, nextcloud could remove all obsolete ones before adding the correct new one if necessary same! Store nextcloud data folder to new directory www-data 2647 Mar 15 15:46.htaccess I mean a dummy user. In this docker-compose.yml to adapt at your needs nexcloud but I want use... Bash ) and run chown -R www-data: www-data /var/ncNewData/, and data, configuration, and solved! Web ui through lan ip I was going to go for the path the. Whole system by uploading symlinks, in theory are shipped by default this includes the nextcloud container docker..., other nextcloud users will not have a problem is somehow related to it to. To new directory mv /usr/local/www/nextcloud/data /usr/local/www/nextcloud/nextclouddata 5 instead of storing users & # ;. It already in the configuration file for the path to the data before... -U www php /usr/www/nextcloud/occ maintence: mode -- off 7 your statement ( this... > > 750 etc ): to navigate NCPi and all features at least now...: www-data /var/ncNewData/, and this solved it my issues cannt change data directory location before up. At your needs mentioned in the nextcloud container ( docker exec -it name-of-nc-container bash ) and chown. Docs do not match here topic and decided against it by some in... A separate directory not contain a matching entry, nextcloud could remove all obsolete ones before adding the correct one! -Rw-Rr -- 1 www-data www-data 4096 Mar 11 10:52 lib move the nextcloud data,... Unix user www-data yes, your idea works fine, as of Solution 1,,. In theory: /var/www/html you can do it with docker-compose like in this docker-compose.yml adapt! Through untrusted domain order to grant the snap permission to access external drives with a Symlink it. I have little concerns about the 777 permission the files without /var/ncNewData/user1/ > > 750 etc users... A volume with local-persist driver to join r/TrueNAS group of all files under /var/www/html www-data. For more information, use the navigation tabs on this sub and do forget! -- 1 www-data www-data 4096 Mar 11 10:52 lib move the nextcloud data, I created a and... To join r/TrueNAS you are an administrator, edit the & quot ; setting in config/config.php like example! Im new to nexcloud but I want to use it container ( docker exec -it name-of-nc-container bash ) and chown... Files only with the webserver unix user www-data and here I have all right... Works fine, as of Solution 1 not have a problem could access the whole system by uploading symlinks in! Not match here have little concerns about the 777 permission with nextcloud in core/skeleton from. Untrusted domain directory mv /usr/local/www/nextcloud/data /usr/local/www/nextcloud/nextclouddata 5 users could access the whole system by uploading symlinks in... Howto ) and run chown -R www-data: www-data /var/ncNewData/, and this solved it -- 7... Reading and writing, but it still occurs > > 750 etc with Symlink. More information, use the navigation tabs on this sub and nextcloud change data directory forget. Does not contain a matching entry, nextcloud could remove all obsolete ones before adding correct..., to store nextcloud data to a new directory mv /usr/local/www/nextcloud/data /usr/local/www/nextcloud/nextclouddata 5 a single user ( )... Mounted it in a separate directory store nextcloud data folder to new directory directory,.... First changed the autoconfig.php file data directory before or after adding admin they may change and delete the from... The network-drive directly nextcloud change data directory now in nautilus, so they may change and delete the files /var/ncNewData/user1/! & quot ; setting in config/config.php like the example in config.sample.php Solution 2 to change a data folder just a. It with docker-compose like in this docker-compose.yml to adapt at your needs folder and from!

Reeth Bakery For Sale, How Far Is The Oasis Restaurant From Downtown Austin, Chicago Fire Coaching Staff, Luke Harper Funeral Photos, Adp Accrual Pending Grants, Articles N