A Nextcloud migration typically involves trans­fer­ring data from one Nextcloud server to another, or switching from other platforms, like ownCloud, to Nextcloud. The reasons behind this migration can vary, from hardware upgrades to changing hosting services.

What are the reasons for migrating Nextcloud?

Migrating to Nextcloud or changing your server can make sense or even be necessary for several reasons. Often, it’s driven by the need for better per­form­ance, enhanced security, or increased flex­ib­il­ity drives. Common mo­tiv­a­tions for server migration include:

  • Upgrading hardware for better per­form­ance: When the current in­fra­struc­ture is stretched to its limits - due to growing user numbers or expanding data volumes - upgrading to more powerful servers results in no­tice­able im­prove­ments in speed and stability.

  • Switching from virtual en­vir­on­ments to physical servers: Many migrate from virtual software solutions to physical servers for added computing power. Physical servers often deliver better per­form­ance and re­li­ab­il­ity.

  • Switching hosting provider: Another common reason is the desire to change Nextcloud hosting provider, whether this is to save costs, gain better support, or comply with stricter data pro­tec­tion reg­u­la­tions.

  • Nextcloud func­tion­al­ity: The open-source nature of Nextcloud offers a wide range of features and high scalab­il­ity through apps. This makes it an appealing option compared to typical Nextcloud al­tern­at­ives.

What are some common scenarios for migrating Nextcloud?

Several scenarios can prompt a Nextcloud migration. The most important factor, however, is where the data is stored and where it will be trans­ferred. The most common migration scenarios are:

  • Migrating from Nextcloud to Nextcloud: This involves trans­fer­ring data between two Nextcloud servers, typically to take advantage of more powerful hardware or a different hosting provider. Nextcloud’s export/import feature, which has been available since version 24, is designed for this scenario. It allows you to export data from an archive and migrate it to the new server.

  • Switching from another platform to Nextcloud: This scenario typically involves migrating from other platforms like ownCloud to Nextcloud. The switch is often made to benefit from the wide range of Nextcloud apps, a sup­port­ive community, and the software’s superior scalab­il­ity. First, data is exported from the old platform, before migrating it to Nextcloud.

  • Migrating data from a local database to the cloud: In this scenario, locally stored data, apps, and digital resources are partially or fully moved to a Nextcloud en­vir­on­ment. The extent of the migration largely depends on the reasons for the switch and the specific ob­ject­ives.

Note

Migrating an existing Nextcloud instance to IONOS’ Managed Nextcloud is not possible. However, if you have files stored in other cloud services, you can integrate them, allowing you to access all your previous data from a single interface.

How to migrate Nextcloud to a new server

Migrating to a new server requires careful planning. The following guide outlines the steps for suc­cess­fully trans­fer­ring your data. Always create a backup of all important data before starting the migration process. This means you can easily restore your system if something goes wrong.

Step 1: Prepare the new server

  1. Install the desired operating system on the new server.

  2. Set up the necessary com­pon­ents, including the web server, PHP, and the database of your choice (MySQL, MariaDB, Post­gr­eSQL, Oracle).

  3. Make sure the PHP version and all relevant PHP ex­ten­sions are com­pat­ible with your Nextcloud con­fig­ur­a­tion.

Step 2: Put Nextcloud into main­ten­ance mode

  1. Put Nextcloud into main­ten­ance mode on the current server using the following command:
sudo -u www-data php occ maintenance:mode --on
bash
  1. Wait a few minutes for all sync clients to recognise the main­ten­ance mode. Then, stop the web server running Nextcloud.

Step 3: Back up and transfer the database

  1. Perform a database backup (dump) for your existing in­stall­a­tion.

  2. Transfer the database backup to the new server and import the data into the new database.

Step 4: Copy the files

  1. Copy all files from your Nextcloud instance to the new server.

  2. Make sure the data files retain their timestamps. Otherwise, clients will have to re-download them after the migration. Use the rsync syn­chron­isa­tion tool for this:

rsync -avz --progress --times /path/to/nextcloud/ /destination/path/
bash
  1. If any file paths change during the Nextcloud migration, make sure you update the paths in the Nextcloud config.php ac­cord­ingly.

  2. Run this command to resolve any in­con­sist­en­cies after migration:

sudo -u www-data php occ maintenance:repair
bash

Step 5: Check data fin­ger­print

  1. In the config.php file of the original system, check whether a data-fingerprint value has been set.

  2. If it has, run the following command on the new server:

sudo -u www-data php occ maintenance:data-fingerprint
bash

Step 6: Do a test run on the new server

  1. Start the database, web server or ap­plic­a­tion server, and the Nextcloud ap­plic­a­tion.

  2. Check if the main­ten­ance mode is still active, if a log entry is created, and for any error messages.

  3. Disable the main­ten­ance mode and log in as an ad­min­is­trat­or to check that everything is working as expected.

Step 7: Update DNS Entry

Update the CNAME record in your DNS settings to redirect users to the new server location.

Note

Apart from ac­tiv­at­ing main­ten­ance mode, avoid making any changes to the original system. If issues arise, you can revert to the old instance. Depending on the size of your instance, migrating Nextcloud may take several hours.

Root Server
Rent a root server
  • Virtual, dedicated or cloud servers
  • Remote main­ten­ance
  • Freely con­fig­ur­able

How to migrate from ownCloud to Nextcloud

Migrating from ownCloud to Nextcloud is similar to per­form­ing a manual upgrade. The versions of both cloud ap­plic­a­tions need to be com­pat­ible, so you can only migrate from ownCloud 10.13.x to Nextcloud 25.0.x (at least 25.0.13). To migrate ownCloud to Nextcloud, follow these steps:

  1. Create a backup: Always make a backup before starting the migration.

  2. Download the com­pat­ible Nextcloud version: Get the ap­pro­pri­ate version of the software from the Nextcloud archive page.

  3. Perform the upgrade: Follow the official Nextcloud upgrade in­struc­tions to install Nextcloud over the existing ownCloud instance.

  4. Adjust the database: After the update, run these commands (after running occ upgrade) to properly configure the database:

occ db:convert-filecache-bigint
occ db:add-missing-columns
occ db:add-missing-indices
occ db:add-missing-primary-keys
bash
  1. Check CronJobs: If CronJobs were set up in the old con­fig­ur­a­tion, make sure they are now con­figured via PHP command (instead of occ system:cron), and set up as Nextcloud CronJobs.

  2. Upgrade to the latest Nextcloud version: Use the in­teg­rated Nextcloud updater to update to the latest version.

  3. Check warnings: Look for any security or setup warnings in the ‘Overview’ section of your Nextcloud settings.

  4. Check and re­act­iv­ate apps: After the Nextcloud migration, some ownCloud apps might be disabled. Reinstall the Nextcloud versions of these apps with these commands:

occ app:enable calendar
occ app:enable contacts
bash
Cloud Backup powered by Acronis
Mitigate downtime with total workload pro­tec­tion
  • Automatic backup and easy recovery
  • Intuitive schedul­ing and man­age­ment
  • AI-based threat pro­tec­tion
Go to Main Menu