Migration to new NC server; not seamless for users

I’ve got a Nextcloud server running on CentOS 7 and I’ve been trying to migrate it to a new Debian 12 system. Like many I was dealing with PHP version issues and decided it was easier to just rebuild and copy the files over (file syncing is mostly what the server is used for). The plan is to swing the DNS CNAME record when the cut-over is to take place.

Anyway, I think I’ve got the migration process down pat with one exception – sync clients. The sync clients go “offline” and refuse to do anything. The only way I can get it to work is to wipe the NC desktop sync config out and set up a new server instance (which forces a long file sync). I’d like the process to be seamless so that users don’t have to do anything (make the whole process transparent) – I’m under the impression that this should be doable.

Both servers are running MariaDB. I’ve even tried copying over instance_id (before the DB setup on the new server) which doesn’t seem to help matters as far as desktop sync is concerned.

Any help you can provide would be helpful.

Are you using the migration approach described in the Admin Manual? Migrating to a different server — Nextcloud latest Administration Manual latest documentation

It addresses this topic.

P.S. You can match PHP versions to the old installation by using the Sury PHP repository. As long as Nextcloud Server versions match, you follow the documented migration process. Once that’s done, if you also wish to upgrade Nextcloud itself on the new server that’s fine. But don’t do it beforehand.


You can’t just copy databases over. There are other databases / schema / etc that it will rely on. You need to backup / restore, specifically follow the article by the poster above.

There are going to be various API tokens and countless other things that need to be transferred over otherwise your client authorizations won’t actually transfer over.