Combined upgrade and migration (9.0.1 to 10.8.0)


We’re in the process of migrating our old ownCloud instance (owncloud 9.0.1, Ubuntu 14.04.2, PHP 5.5.9, mysql Ver 14.14 Distrib 5.5.47), and have got as far as setting up a new host (Ubuntu 20.04.3, PHP 7.4, ownCloud 10.8.0, mysql Ver 15.1 Distrib 10.3.32-MariaDB).

The migration doc suggests we’re at the point where we could put the old server into maintenance mode and transfer the database, but I noticed that the database on our new instance contains slightly different tables, and that some of the tables have different schema. Can we go ahead with the migration despite the database differences, or do we need to upgrade our old instance first? It looks like we wouldn’t be able to go straight from 9.0.1 to 10.8.0, we’d need to go to 9.0.9 first, so would the upgrade from 9.0.1 to 9.0.9 make the changes to the database tables/schema that would allow us to migrate from there to 10.8.0, or would we need to take our old instance all the way to 10.8.0?

Alternatively, the data are NFS mounted so transferring them shouldn’t be an issue, and most users are LDAP, so would restoring from scratch be a better option? We do have some none-LDAP users, but the oc_users schema looks to be the same in both databases, so hopefully that shouldn’t pose a problem. On the other hand, there are quite a few shares (>1000) that we’d need to re-create, and the oc_shares table schemas do look different.

I’d be very interested to hear about other peoples experiences of combined upgrade/migration - I had a look at some of the previous posts on the subject, but they didn’t seem to cover quite the same ground.

Many thanks in advance - any advice on the best way forward would be greatly appreciated.

Note the upgrade path table, when you scroll down a little. You have to upgrade to 9.0.9 first. The database migrations will be part of the different occ upgrade commands.

I recommend to test it in a cloned instance. Because this might take a long time, depending on your database size.

You will lose all share information, when starting from scratch. Files will get new file ids and you won’t be able to operate the old share information into a new instance.

I think the most important is to do a test migration it in a test instance and document the process as detailed as possible so you only have to copy paste commands when doing it in production.

Also between the two states, don’t try to change too many things at once, e.g. don’t also change the path for the datadirectory.

1 Like

Thanks for your advice Erik, much appreciated. And good point about testing on a clone first… It might be a while before I get chance to revisit this, but I’ll let you know how it goes.

Hello again,

I updated a clone of our old server to v9.0.9 and it seems to be running without any issues, but the database schema appears to be unchanged. The upgrade did report that it was “Updating database schema” and that it had “Updated database”, but maybe some part of the process didn’t complete properly?

Should the upgrade from 9.0.1 to 9.0.9 have changed the database schema in any way?

In case it’s relevant, I’m comparing the schema by running:

mysql -u oc_admin -p -e “select * from columns where table_schema=‘oc’;” information_schema > ./oc_-schema

on each sever, then:

comm -3 <(sort ./oc_v909-schema) <(sort ./oc_v901-schema)

If the database schema is the same in 9.0.1 and 9.0.9 (and an upgrade from 9.0.9 to 10.8.0 would be possible), is there any reason not to:

  • Delete the existing (empty) database on our new 10.8.0 instance (not yet in production)
  • Export the database from our 9.0.1 instance and import to our 10.8.0 instance
  • Run occ upgrade on the 10.8.0 instance?

I looked at upgrading the clone to 10.8.0 to see what that would do to the database schema, but it seems that getting 10.8.0 running on Ubuntu 14.04 would involve building PHP7 (and any modules) from source, so I’d prefer to avoid that if it’s not necessary.

Thanks again for your help

I wouldn’t expect there to be too big differences between the schema, especially as it is only minor versions 9.0.1 to 9.0.9. However versions before 10 of ownCloud are way before my time. If there are no error messages and everything else works fine, I wouldn’t be too concerned. Perhaps @cdamken has some more input?

Thanks Erik - it looks like I was worrying about nothing… After making a couple of changes to the database imported from our 9.0.1 instance, the upgrade to 10.8.0 worked pretty smoothly, and the new instance seems to be working as expected.

The changes that I needed to make included altering the data type on a couple of fields, and disabling some outdated apps:

alter table oc_activity modify subjectparams longtext;
alter table oc_activity modify messageparams longtext;
sudo -u www-data /var/www/owncloud/occ app:disable files_videoplayer
sudo -u www-data /var/www/owncloud/occ app:disable gallery

There area still a couple of (very minor) differences between the upgraded database and a native 10.8.0 database, but nothing I’m too concerned about.

Thanks again for your help.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.