Made a boo-boo, deleted files server-side, how to fix?

Hi all - recently I moved from server to server with my hosting. Not all stuff from the old server was moved yet, and yesterday I made the mistake that I forgot I’ve already migrated my whole owncloud setup (5 users, not a big one) to this new server, and I decided to do it there and then, again so to speak.

So what happened is I did an rsync from the old server (actually not active for owncloud anymore) to the new server (actually running owncloud at this time). So this would be an rsync from old servers’ owncloud Docroot to new servers’ owncloud Docroot (rsync -a --delete), and a copy of the database from old to new. So docroot and database ‘match’, but the clients connected will see the files that were uploaded to the server via the sync client will have been deleted (or altered with a state of about 2 months ago). So basically the server went back in time about 2 months.

I’ve managed to fix all accounts but one, this is a Windows desktop (my parents in law) that use this setup purely for backup purposes. Their computer was not on at that moment, and I immediately firewalled (blocked) their IP on the server so they can’t connect, untill I know how to fix this stupid mistake.

I have the log from rsync, so I know exactly which files are either deleted on the (new/current) server or overwritten by files from the old server. The files on the desktop are all still untouched and correct, because the sync client hasn’t connected yet since.

I’ve done a few tests with my own account but I can’t really determine what the sync client is going to do once it connects. Today I’ll visit them and the first thing I’ll do is make a local backup of the sync dirs on that desktop, so at least I’ll have a copy of everything that’s important.

What would be the best way to fix this? Delete everything on the server, setup the clients from scratch and let it copy everything again (it’s about 50GB and their internet connection is pretty slow)? Is there a better way to fix this?

My first suggestion, after testing the files:scan option on the server, is:

Once I get to this desktop (which has still not connected since the boo-boo), I make a copy of all the files in the sync-dirs on a seperate harddisk. I then let the owncloud sync client connect. If it asks me to Keep files or Delete, I’ll click Keep and that should be OK then.

If the sync client decides to sync with the server and delete a bunch of local files, I’ll let it. When it’s done, I’ll select all from the separate harddisk, and copy it over the sync dirs on the computer (Windows will figure out which files already exist, and prompt me to not overwrite them).

I’ve already seen that I won’t have files that are updated/changed in this time period, only new files that were placed since then, and I had removed from the server.

Does this sound right?

Like many times in this forum, this issue is highly specific to your environment. The best way to figure out how exactly it behaves is to test it. From what I have just read though, you sound highly competent :wink:

I would just like to point your attention to this article in our documentation about restoring ownCloud:

Run maintenance:data-fingerprint to tell desktop and mobile clients that a server backup has been restored. This command changes the ETag for all files in the communication with sync clients, informing them that one or more files were modified. After the command completes, users will be prompted to resolve any conflicts between newer and older file versions.

I am not 100% sure what exactly it does, again I’d recommend to test it.