Backup/Restore single user

I am trying to find the best way to migrate single user from one NC server to another. I have 2 NC servers and I wish to terminate one, but there is one active user on it. He has about 200 Gb of data, so just creating user on other server and running sync would take a long time.

Is there a way to do that by simply copying user structure and database entries? Or just user directory structure and running something to create database entries?

Replying to myself. I did copy complete /nextcloud/data/USER from server1 to server2, created user and password on server2 and ran sudo -u www-data php occ files:scan USER

I don’t know if this is the right way, since I can’t try client syncing right now.

I think it is a very good plan. Please make a backup of the old (new created) folder for the user on server2. Also you can only copy data/user/files (without trash, versions, …). I do not really know if nextcloud update the database correct with e.g. trash files and versions. Perhaps you do not need them.

An alternative is to copy files from one nextcloud account to another nextcloud account with “federated sharing”. But i think 200 GB is a lot of data to use it. it could be very slow because of usage of WebDAV between the two nextcloud servers. But you do not need to download the data.

But if you have root-access to both nextclouds you can better use “rsync” and “ssh” to copy the data between the both servers and use your solution.

Well. This solution is not ok. Client started syncing everything from the beginning :frowning:

I think you can not change it because the files on the client / server 1 are different from client / server 2 although they are on the client and both server bitwise identical.