Migrating from NC 15 to 21

Original build:
Nextcloud version 15.02
Operating system and version Ubuntu 18.04lts
nginx version 1.17
PHP version 7.4
Mysql 10.4

New build:
Nextcloud version 21
Ubuntu 20.04
Nginx 1.19
PHP version 8
Mysql 10.5
The issue you are facing:
My original build, on a VM, started to go bad. Now I am trying to recover and migrate my data to a new machine. I created a fresh install (2nd build). Now I want to migrate the data from the original build to the new. Is this possible? I should be able to access the data (nc_data) and make a sql dump. Are these files going to be enough to migrate to the new platform? (I’ve seen many backups seem to restore the whole nextcloud folder – but that contains new settings for new version - so that seems doomed to screw everyting up nicely?).

All help really appreciated! :grinning:

Id suggest to recover to the old build version first by restoring a backup or something, then you would need to upgrade through each major version step by step up to latest, otherwise your DB will be broken afaik. So have a fresh install of 15.x.x whatever you had, then restore DB and data, and then upgrade through each Version…

Migrating from v.15 to v.21?
Copying over data should not be a problem.
Everything else - users, rights, etc. - I’d recommend to do from scratch…

Thanks

Everything else - users, rights, etc. - I’d recommend to do from scratch

So I guess you mean re-create the database from the data structure? How would I go about doing this?

I also have some apps e.g., calendar - will this “find” the data if I enable them again?

and then upgrade through each Version…

Then I guess I can migrate to the new system (with newer versions of PHP etc.?

No, i guess 15 wont run un php 7.3…

calendar data is stored in the database (as also data from some other apps is). So, if you only copy the files and do the rest from scratch, calendar data will be lost.

You could use calcardbackup to export calendars (and addressbooks) from the old version and then reimport the calendars to the new version (preferrebly with the help of a client). This approach is not practicable with a large user base, though.

Thanks for the input. I gradually updated to 21 fixing errors as I went. Then I migrated nc_data and a database dump to my new server.

This seems to be working so far - no errors as of yet.

The problem is the calendar has complete disappeared (i.e., not showing in the menu bar)
When I look at the Apps - is shows “0”
but running sudo -u www-data php occ config:list calendar

{
“apps”: {
“calendar”: {
“enabled”: “yes”,
“installed_version”: “2.3.1”,
“types”: “”
}
}
}

I cannot disable the calendar app. I think I need to remove / repair / reinstall the calendar and then reconnect it to the data? (since that must be in the database already)

I appreciate any input on how to go about this. Thanks!

Well I managed to disable it (in the interface). Then update at the command line:

sudo -u www-data php occ app:update calendar

The correct version appeared in the App list, now, and it imported my data :smiley:
Happiness!

1 Like