Articles with the tag:
Close
Changelog
Close
Try in the cloud
Try in the cloud

Migrating Nextcloud data to ONLYOFFICE DocSpace

Introduction

In this article, we will show you how to transfer the Nextcloud server data to your ONLYOFFICE DocSpace.

Starting from v 2.5, ONLYOFFICE DocSpace supports exporting Nextcloud users, users’ files, sharing settings and groups.

Export data from Nextcloud

Enabling the maintenance mode

First, you need to enable the maintenance mode on your Nextcloud server. The maintenance mode stops the server and allows us to export data from the Nextcloud installation folder and MySQL database. To activate the maintenance mode:

  1. Go to the folder with the Nextcloud installation.
    cd /var/www/html/nextcloud
  2. Run the occ file to enable the maintenance mode.
    sudo -u www-data php occ maintenance:mode --on
    Depending on the operating system, the location of the Nextcloud installation folder might differ.

Exporting the data folder

To successfully migrate your data to ONLYOFFICE DocSpace, we need to include users' folders in our backup archive. They are located in the data folder within the Nextcloud directory.

To export the data folder run the following command:

sudo rsync -Aax /var/www/html/nextcloud/data [preferred location]/data/

Where [preferred location] is a destination of the exported folder.

Exporting the database

Also, we need to export the MySQL backup file. There are two possible ways of dumping the database.

In case the database is deployed on the same server, execute:

sudo mysqldump --lock-tables -u root -p nextcloud_db > [preferred location]/nextcloud-dirbkp_`date +"%Y%m%d"`/

Where [preferred location] is a destination of the exported folder.

If the database is deployed on a different server, run the following command:

mysqldump --single-transaction -h [server] -u [username] -p[password] [db_name] > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak

Disabling the maintenance mode

After all the necessary folders and files have been exported, we can disable the maintenance mode and start the Nextcloud server.

To do that, go to the Nextcloud installation folder and execute:

sudo -u www-data php occ maintenance:mode --off

Prepare the data for import

In order to import the data, you need to compress certain files and folders to a zip archive. The archive.zip file contains the data folder which stores the folders of the Nextcloud users and the database backup file. The structure of the archive.zip file looks as follows:

-archive:
    - data:
        - user1
        - user2
        - user3
    - MySQL backup file
We recommend storing only users' folders within the data directory. Storing the remaining files and folders within this directory might cause mistakes when importing the data.

Exporting with snap

If you are using Nextcloud installed with the snap package, run the following command:

sudo nextcloud.export

It'll turn on maintenance mode and dump a backup of your entire instance into a timestamped folder, something like 20240723-103102, inside /var/snap/nextcloud/common/backups/.

After the export is complete, create the .tar archive with a command like this:

sudo tar -cvf 20240723-103102_nextcloud-backup.tar /var/snap/nextcloud/common/backups/20240723-103102

Import the data to ONLYOFFICE DocSpace

  1. Log in to your ONLYOFFICE DocSpace.
  2. Use the Options icon menu in the lower left corner and select the Settings option.
  3. Choose the Data import section.
  4. Click the Import link next to the Nextcloud service or the Nextcloud item itself.
    Migrating Nextcloud data to ONLYOFFICE DocSpace Migrating Nextcloud data to ONLYOFFICE DocSpace
  5. Click the folder icon next to the selection box or the 'Backup file' box itself and select the archives of the users.

    Wait for the archive to load. When the loading is complete, click the Next step button.

    Migrating Nextcloud data to ONLYOFFICE DocSpace Migrating Nextcloud data to ONLYOFFICE DocSpace
  6. Select users from the list and click the Next step button. Only users with e-mails will be migrated first.
    Migrating Nextcloud data to ONLYOFFICE DocSpace Migrating Nextcloud data to ONLYOFFICE DocSpace
  7. Now you can select not filled e-mail users and fill in their e-mail addresses. To do that, fill in the user's e-mail address. Click the Tick button next to the e-mail text box. Select several users from the list by ticking users' checkboxes. Proceed to the next step by clicking the Next step button.
    Migrating Nextcloud data to ONLYOFFICE DocSpace Migrating Nextcloud data to ONLYOFFICE DocSpace
  8. Select user types (DocSpace roles: DocSpace admin, room admin, power user) and click the Next step button.
    Migrating Nextcloud data to ONLYOFFICE DocSpace Migrating Nextcloud data to ONLYOFFICE DocSpace
  9. Select modules for import (users, groups, personal files, shared files, shared folders). Click the Start data import button to proceed with the final step.
    Migrating Nextcloud data to ONLYOFFICE DocSpace Migrating Nextcloud data to ONLYOFFICE DocSpace
  10. After the data is migrated, click the Finish button to complete the data import.

    Use the Download log button if you want to download information about migration, as well as errors occurred.

    Migrating Nextcloud data to ONLYOFFICE DocSpace Migrating Nextcloud data to ONLYOFFICE DocSpace

Also, you can send a welcome letter to the new users. This letter will inform your users about migration to ONLYOFFICE DocSpace. It contains a brief description of the main features and a login link. To send the letter, check the Send invite letter option before clicking the Finish button.

After the migration is complete, the new users and groups can be found in the Accounts section.

Personal files and shared files can be accessed through the Documents section. Shared folders can be accessed through the Rooms sections.

Try now for free Try and make your decision No need to install anything
to see all the features in action
You Might Also Like This:
Close