Link to real data?

I am trying to link my data folder to the one nextclowd is using. I have tried a mount and a symbolic link nut none work (the shell does see the content though)

I this meant not to be working for somereason? Or rather a bug? is there alternatively a different way ican achieve this?

Thanks

I might misunderstand what you’re trying to do, but you can also add this in config/config.php:

‘datadirectory’ => ‘/path/to/your/data’,

also:

$ touch /path/to/your/data/.ocdata

Moving the data-directory is not supported (https://github.com/nextcloud/server/issues/137). It seems to work at first, but there are some issues (reports on failing background-jobs, …) because it is at several places in the database (perhaps also some apps).

This is something I did not know, I never encountered any issue with my current setup and I have my data out of the nextcloud folder. Well, I mean that I never had any strange thing in my logs regarding the data/file.

@tflidd: Should I put the data back to the original path ?

That’s the secure option. There were some strange errors. It would be good to be able to change the data-directory. Especially because it is working most of the time, there are many people doing that already. Some also scanned their database for the occurrence of the data-path, that’s probably better than changing it just in the config.php. But still, it is a manual workaround.

Presumably this is only moving the data dir after installation rather that choosing a dir during installation, right?

Yes, during installation you can choose your data/-directory. It’s only about later changes.

It was one of those things that made me look twice at the comment… So I thought it best to check :slight_smile:

So I suppose I could put the real data in nextcloud and link it to where it is at the moment…?

You can’t use links within the data/-directory, but the data/-directory itself could be linked (never tried it myself but I think some users did this).

Thanks that answer my original question, my latter post though is referring to having external folders (where currently data lives) linked to nextcloud date. So nextcloud host the real data where other locations just point to it. Can’t see why shouldn’t work but I thought I’d better off asking…

I’m not sure if I understood your question correctly. You want to move your main Nextcloud data/-folder to a different location using symlinks? (the answers refer to that).
What you can do: link /var/www/nextcloud/data -> /path/to/storage/…
what you can’t do: link /var/www/nextcloud/data/user1 -> /path/to/storage/user1
link /var/www/nextcloud/data/user2->/other/path/user2

Apologies I haven’t explained myself very well I admit.
I currently have my data on a completely different folder and have been using rsync for many years to sync to a remote server. I have now installed nextcloud on the NAS, since my existing data is found elsewhere (/mnt/raid5/mydata folder), I guess I could move everything into nextcloud (/mnt/raid5/www/nextcloud/somewhere) and create filesystem symlinks FROM /mnt/raid5/mydata to have the data accessible from where it used to be without reconfiguring everything.
So:
move data into nextcloud
link old data location to nextcloud data/user folder

I think it all boils down to: since there are problems having nextcloud handling symlinks to external folders I just wanted to make sure that symlinks pointing TO nextcloud don’t create any problem either. I can’t see how but I prefer to ask first :slight_smile:

Thanks!

Ok, I see. The link itself is no problem. Only thing is that Nextcloud uses its data folder exclusively, that means it won’t “see” if you change files manually (no problem if you read data only). So if you want to have some storage available (read+write) by Nextcloud and other processes, it is better to use the external storage feature.