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


Navigation

    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    UNSOLVED Migrate Nextcloud - Keep Nextcloud Users and Settings

    Nextcloud
    migration nextcloud usermanagement
    2
    6
    1215
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • tobru
      tobru last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • nebulon
        nebulon Staff last edited by

        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 https://cloudron.io/documentation/apps/nextcloud/#running-occ-tool 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?

        tobru 1 Reply Last reply Reply Quote 0
        • tobru
          tobru @nebulon last edited by

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

          1 Reply Last reply Reply Quote 0
          • nebulon
            nebulon Staff last edited by

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

            1 Reply Last reply Reply Quote 0
            • tobru
              tobru last edited by

              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 files.example.com -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' => '13.0.0.14',
                'dbname' => 'nextcloud',
                'dbhost' => '172.18.0.10',
                '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.

              1 Reply Last reply Reply Quote 0
              • nebulon
                nebulon Staff last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post