Sync from client to server

Hi there,

My server fell over and was too complicated for me to fix as I don’t have the knowledge. Also there were some hardware issues so I have set a new machine up with a brand new (as of today) installation. I am using Nexcloud on Docker using OpenMediaVault V6. We have devices that sync to Nextcloud; two laptops and a desktop, all running the client.

All of the files that we need to keep are on the laptops and desktop, so I’d like to keep them under ‘Nextcloud’, not ‘Nextcloud2’ and sync them all back over to the new instance of Nextcloud.

Can somebody knowlegeable guide me through this if its possible, please?


Start by making a copy of the existing folder in case of any mishaps.

I would rename the existing folder, let it create and sync the new empty Nextcloud folder, and then move the contents back in and let it sync it all. It’ll take some time, but this is probably the safest approach.

1 Like

Hello Karl,

Many thanks for your help here.

Sadly, I last night disconnected the Nexcloud client on my machine and, after rebooting this morning all my directories had vanished! Luckily, I managed to boot up the old server. Nextcloud isn’t available there and I don’t have time to look into it at the moment as I’m off to work.

However, I did manage to ssh into it using FileZilla and I am currently copying all the files back to my Windows machine.

I’ll let you know how this goes.



Unfortunately, many users still believe that if you use a client and server, you have a backup. This is not the case because the data or not-data is on both sites the same (if sync is used). :wink:

Either you have to backup the data locally (e.g. on an external USB hard drive) or you have to backup your Nextcloud on the server side. If someone uses Managed Nextcloud buy a backup service from the provider or manage the backup at home.

Nextcloud is no backup. For backup search other tools.


@devnull I totally agree.

Thankfully, it seems my files are safe. I’ve looked into backing up before but never really found anything that suited my level of knowledge with regards to the inner workings of OpenMediaVault, Docker Nextcloud, the command line, etc.

What I’d really like is to be able to periodically (manually) mirror the system drive and data drive so that I could just plug either one or both of them back in in the event of a failure but I’ve never really come across anything that I had the ability to set up.

I think i will definitely be backing up the files to USB in the future though - that would at least keep those safe.


Please read Backup and Restore. To save informations like public shares, usernames, contacts, … you must also backup/restore the Nextcloud database.

If only data is important, you can also back up only the directories (local or at the server) and in case of failure reinstall Nextcloud with a new configuration and new users, contacts, …

1 Like

@devnull, many thanks for the pointers.

How do you use the command line, can this just be done using ssh? Sorry for the ignorance!


Yes SSH. For administration a server you normally do not need a GUI. Especially in case of an error (worst case) the GUI may not work at all. You should definitely build up Liux knowledge on the command line.

But I also think that your GUI can make a backup (data and database) and that you might get it restored. Try to see if this really works.

1 Like

Hi @devnull, many thanks and I will look into things.

Because of the way disks are mounted, it’s unlikely you could set them up to be swappable without at least a little CLI intervention.

I don’t know anything about OpenMediaVault, but if it has some sort of built-in backup utility (or one can be installed), I suggest using a USB external drive for the backup.

While a disk mirror is ok to protect against complete system failure, it doesn’t have multiple backup revisions, so it’s useless in cases of data corruption, ransomware, etc. as the bad data will simply be backed up and overwrite the only copy. Something to bear in mind as I don’t really recommend manual backups either… since people forget to do them regularly.

1 Like

Many thanks, @KarlF12 - I will look into that also. Thanks for the advice!

Sorry - just to be clear on this as its been a long time since I’ve set the client up:

My (PC) now has no Nextcloud directory, so is it best now to just set up the client and tell it I’ll set the sync directories up later, then drag my backed up ones into the ‘Nextcloud’ directory and let all of them (and their contents) sync up to the server?

Thank you.

Not later. Just let it sync the new empty Nextcloud folder. Then put your stuff in it and let it sync up.


@KarlF12, thanks for the reminder - that makes sense and is chugging along nicely now.

Thanks! :+1:

@KarlF12, all going well now and thanks for the guidance. My wife has a gazillion photos so can I scp or rsync (once I learn how) these files and does nexcloud need to scan them or something afterwards?

Thanks again,

Yes it does, if you manually add/remove/change anything in the data folder, you have to run occ files:scan.

Thanks - I don’t understand the term: “Run occ as your HTTP user” Does this mean I need to go to a certain place (directory) before I use it? Sorry but I’m new to the CL - I always use root when i use it (I know, I shouldn’t!)

Your web server that runs Nextcloud runs as a particular user. It means that user. For example on Ubuntu by default this user is www-data.

occ needs to be run as the same user Nextcloud runs as.

Hmmm, thanks for that but it doesn’t mean much to me. I think I’ve found an alternative by using the app WebOCC though. Thank you.