Seeking advice on migrating my data to new server

I had to ditch the server I was using Nextcloud on.

I’ve set up a new server. The path to NC is different from the previous server.

I have created a new DB for NC.

I have Calendar and Contacts data I want to get into the new NC instance.

I have Contacts data on my phone (which has been unable to sync to the server since it was ditched a few months ago). I also have Contacts data on my computer. I suspect contacts have been added and/or modified on each (phone and computer).

I have a full mysql dump of the previous NC database instance. It is obviously not in sync with the phone and computer. Basically all three are out of sync with each other.

I would like some advise on the best way to go about getting the three synchronised. I suspect I could make a real botch of it if I don’t go about it the right way. I have fairly limited knowledge of how syncing works over CardDav, in terms of how merging of changes is handled, etc., so there’s a high chance I’ll not go about it the optimum way.

Thanks very much…


For one, you’re going to want to disconnect your clients from the server. You’ll probably want to do those from scratch if they’re that far out of sync. Things you’ll need for migrating:

  1. The nextcloud data directory
  2. mysql dump
  3. nextcloud directory

You will have to import your mysql dump and recreate the user that will maintain that database, put the nextcloud directory and your data directory in their respective places in accordance with your nextcloud config.php file. You will also have to make sure your mysql, php and web server configs are appropriate. From there you should be able to start your services and go. I did this in August when I moved from Ubuntu to FreeBSD…not a very scary process if it’s a personal setup as it seems to be here. Once the server seems operational, you can reconnect your clients to the server

Thanks for the help.

You’ll probably want to do those from scratch if they’re that far out of sync.

When you say do them from scratch, what do you mean exactly?
There are some contacts uniquely on the phone and some uniquely on the desktop.
So I was thinking I may have to export the contacts from each, combine them, and import them into the desktop contact app, and then sync that onto the new NC installation. Does that sound about right?

What is the “Next cloud data recovery” referring to?

The rest sounds pretty straight forward. Will have a crack at it this weekend.

For this part in particular I mean you’ll want to create whole new connections to your server instead of relying on an old one that is already set up in the desktop app. For your contacts, yeah I’d look at combining and importing. I’m sure the contacts app is smart to sort out the data, but I can’t say so from experience. That may be another question you’d want to look up or ask if it hasn’t been asked.

I don’t say data recovery anywhere, do you mean data directory? If so, by that I mean it’s the directory where user data is stored. For example, the default would be nextcloud/data (if nextcloud is your webroot)…but for some people (myself included) I move that directory outside of the webroot. It would be the “datadirectory” variable in your config.php file