Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.

UNSOLVED Migrate Nextcloud - Keep Nextcloud Users and Settings

  • I want to migrate my Nextcloud installation to Cloudron but want to keep the already existing users (incl. password - I do not want to use the Cloudron authentication for Nextcloud) and settings (shares, permissions, extensions, ...). How can I do that?

  • Staff

    Unfortunately, I don't think there is some automated way to do this, yet. However you can install the nextcloud app on your Cloudron and select Leave user management to the app during installation, then you somehow have to export and import the database backup. You can get a remote shell connection into the Cloudron app via the dashboard and mentions how to run occ correctly. Regarding importing the files with potentially setup share/access permissions, I am not sure myself how to do this correctly. Maybe there are upstream migration guides which handle that case?

  • @nebulon Thanks for the hints. I'll give it a try and will report back once done...

  • Staff

    @tobru did you try this and did it work out?

  • Yes, it worked. Unfortunately I did no document every step in detail, there were many steps involved. Here are they key steps, it's not a list which can be followed step-by-step, one has to figure out the details by himself:

    • Export DB from old installation (mine was MariaDB)
    • Start a temporary DB server on the Cloudron server and import the DB, something like:
    docker run -d --name=mariadb -v mariadb-temp:/var/lib/mysql -v /tmp/dump:/data -p 3308:3306 -e MYSQL_ROOT_PASSWORD=password --network=cloudron mariadb:10.1
    • Login to your Nextcloud container:
    cloudron exec --app -t bash
    • Update the Nextcloud configuration to point to this temporary DB server and have the exact same version as the old installation. Example (replace values with the ones of your installation):
      'dbtype' => 'mysql',
      'version' => '',
      'dbname' => 'nextcloud',
      'dbhost' => '',
      'dbport' => '3306',
      'dbtableprefix' => 'oc_',
      'dbuser' => 'root',
      'dbpassword' => 'password',
    • Run migration:
    sudo -u www-data php occ db:convert-type --clear-schema --all-apps --password ${POSTGRESQL_PASSWORD} pgsql ${POSTGRESQL_USERNAME} ${POSTGRESQL_HOST} ${POSTGRESQL_DATABASE}
    sudo -u www-data php occ upgrade
    • Move your data from the old to the new Cloudron server
    • Remove temporary DB server and it's data

    It's not very straight forward, but definitively doable.

  • Staff

    Thanks for the reply! Definitely a great start, we will take it from there and refine it to put in our documentation to get more people started.