How to acces user data for backup

How do i access the folder where all the user data is stored? Is it possible to do this by (for example) FTP or Samba? I would like to do so from a Server 2016.

I want to do this because of the backup. Of course i backup the virtual machine hosting the Nextcloud installation.

But when for example i would like to restore a file from a week ago, i would have to restore the complete virtual machine.

So it would be nice to be able to create a backup of the user data seperately.

Any ideas?

https://www.c-rieger.de/nextcloud-backup-and-restore/
of cause you have to adjust all pathes.

you may also look at restic. cool backup program.
https://restic.readthedocs.io/en/latest/010_introduction.html

Thanks for your reply. But this doesn’t help me get to for example a single file. I would like to be able to acces the user files on a windows server. Ideally with a samba share or a ftp connection. But if that isn’t possible of course i am willing to try something else.

I am novice at best when it comes to linux. Of course i am willing to learn a bit, but accessing it through my windows server would be awesome.

to access file on a nextcloud server you can either install the desktop client or use a webdav client for windows.


https://docs.nextcloud.com/server/14/benutzerhandbuch/files/access_webdav.html
https://cyberduck.io/
https://mountainduck.io/

what do you mean by “through”

Through - i meant from my windows server.

Webdav - i will have a look at the links you gave me.
The first one is in german, i cannot read german :slight_smile:

there is a english version as well.
https://docs.nextcloud.com/server/14/user_manual/files/access_webdav.html

net use Z: https://<drive_path>/remote.php/dav/files/USERNAME/ /user:youruser yourpassword

This is almost what i want :slight_smile: but is there a way to show all the user files instead of only one user?

don’t know if that’s possible with webdav. i guess no.

of course you can setup samba and share your data folder. i’m sure there are millions of howtos.
but.
nextcloud keeps track of all file in a database. if you access them through webdav every change is also stored in the database. if you use any other protocol you bypass this.
it’s not tragic. if you know what you are doing. if not you could be confused. when file don’t show up in the gui for example.

the easiest would probably to ftp use an FTP-server on you nc-box. vsftpd is quite secure and pretty easy to configure (and windoze-explorer even understands ftp). but you have to pay attention to file-perms and ownership.
personally, if i HAD to use windoze i’d probably try rsync.exe from cygwin.
if you want to do regular backups you can also go the other way (nc -> windoze). “share” a dir on the windoze-box, mount it on you linux-box and copy/tar/rsync/whatever all the files there.
when that works put it into a script and run it with cron (on the linux-box).
GOOD LUCK!

@pete.dawgg,

Ftp would be great. Do you have a Howto for this? Like I said I am a Linux noob, so I have no idea how to set file permission / how to enable or allow ftp access.

Your other way (share a dir on Windows server) actually also sounds like an good solution, but again do you have a Howto? I have no idea how to mount the share on my Linux nextcloud. With regards to creating a script and running it with cron, do you have a Howto?

If there are no howto’s, could you explain step by step how to do all of this? Doesn’t sound like a lot work and not to complicated for someone who knows Linux. Or am i wrong about that?

Thanks in advance for your help!

Is there no simple way to access the user files? How does everybody backup/recover the files? If you have a lot of users and you need to recover one file from a week ago. I cannot just use my virtual machine backup and set the machine back a week. Then everybody losses there changes made in the last week. Users will simply not accept this.

P.S. @Reiner_Nippes, with regards to the tracking of the changes. Thanks for the tip but this will not be a problem.

normal people use the desktop client or the web gui.

that depends. i use restic and backup the file to an object store (e.g. aws s3).
if you are a home user and you use the desktop client in fact you don’t need backup because the files are automatically sync between nextcloud server and your desktop.

if you read the manual of restic you’ll find the command restic mount that allows you to mount a restic repository. there you’ll find any file ever write to your backup. (if you set it up correct. :wink: )

btw: we have 2018. no one is using ftp anymore. if you are on an intranet using this totally insecure tool might be ok. but i have may doupt.

FTP:
find out what distro you are using and search the docs (and maybe the web) for what ftp-server is appropriate and how to install and configure it. vsftpd is available in most distros.

CIFS/SMBMOUNT:
same as above but find package named smbmount, cifs or the like. some distros install it by default. you do not need the whole samba package. you must be able to run the command mount.cifs (which is equivalent to mount -t cifs)
on your windoze-box, “share” the directory you want to copy the backups to; remember the “domain,” user and its password. the run the mount-command with the windoze-parameters; eg. mount -t cifs -o username=windoze-user,domain=windoze-domain //windozebox/sharename /your/mount/dir it should ask for a password or tell you what goes wrong; if there are problems you should also check the windoze eventlog. it pays to read the mount.cifs manpage and put the neccessary creds into a file.
then you can copy the files from your nc-datadir to your windoze-box. due to the nature of CIFS perms will be different from sourcedir to destdir.
another easy way might be to just hook up an external drive to your vm and copy the files there.
GOOD LUCK!