Migrating from one App to another

/docs/gears/advanced-management/migrating-to-a-new-app/

Motivation

Sometimes, an App gets forked, as it happened with ownCloud and its fork Nextcloud. Sometimes, a developer would make it particularly easy to let users take their data from an old App and use it in their new App. Sometimes, major versions of Apps are sufficiently different from each other that in UBOS, we effectively treat them as different Apps.

Under any of these circumstances, the user needs to be able to tell UBOS to migrate their data and configuration to a new App.

How to migrate from one App to another

For simplicity, let’s assume that a Device only runs a single Site, and that at that Site,a single App is installed whose data and configuration needs to be migrated to another App. Let’s assume that the Site has hostname example.com.

In case of more complex setups, different options to the backup and restore commands need to be used (e.g. only some Sites instead of all), otherwise everything is the same.

Let’s take a real-world example, and assume you want to upgrade from nextcloud18 to nextcloud19 (Note: this is a historical example.)

  1. Create a backup of the existing Site, such as:

    % sudo ubos-admin backup --host example.com --backuptofile before-migration.ubos-backup
    
  2. Undeploy the Site, such as:

    % sudo ubos-admin undeploy --host example.com
    
  3. Restore the backup, instructing UBOS to swap out nextcloud18 and replace it with nextcloud19:

    % ubos-admin restore --in before-migration.ubos-backup --migratefrom nextcloud18 --migrateto nextcloud19
    

This will restore your Site into the same location (hostname, context path), restore and migrate all your data, but run nextcloud19 going forward instead of nextcloud18.