Migrating Nextcloud data to ONLYOFFICE Workspace

Introduction

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

Starting from ONLYOFFICE Workspace 12.0.0. you can export users, their files, and sharing settings to your portal.

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 Workspace, 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.

Import the data to ONLYOFFICE Workspace

  1. Log in to your ONLYOFFICE Workspace.
  2. Go to the Control Panel.
    Creating Backup automaticallyCreating Backup automatically
  3. Choose the Data import from the PORTAL SETTINGS section.
    Creating Backup automaticallyCreating Backup automatically
  4. Click the INITIALIZE IMPORT button in the Nextcloud section.
    Creating Backup automaticallyCreating Backup automatically
  5. Click the Plus button next to the selection box and select the archive.zip file.
    Creating Backup automaticallyCreating Backup automatically

    Wait for the archive to load. When the loading is complete, click the UPLOAD TO SERVER button.

    Creating Backup automaticallyCreating Backup automatically
  6. Select the list of users to be imported into ONLYOFFICE and click the NEXT STEP button. In this step, only users with e-mails will be migrated.
    Creating Backup automaticallyCreating Backup automatically
  7. In this step, you can select not filled e-mail users. You can fill in their e-mail addresses and migrate them to your portal. 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.
    Creating Backup automaticallyCreating Backup automatically

    Also, there is an option to download the unimported users by clicking the DOWNLOAD UNIMPORTED USERS button.

  8. Select modules for import. These modules will appear in the corresponding modules of ONLYOFFICE. Click the START DATA IMPORT button to proceed with the final step.
    Creating Backup automaticallyCreating Backup automatically
  9. After the data is migrated, click the FINISH button to complete the data import.
    Creating Backup automaticallyCreating Backup automatically

Optionally, you can send a welcome letter to the imported users. This letter will inform your Nextcloud users about migration to ONLYOFFICE Workspace. It contains a brief description of the main features and a login link. To send the letter, check the Send Welcome Letter option before clicking the FINISH button.

Creating Backup automaticallyCreating Backup automatically

After the migration is complete, the new users can be found in the People module.

Creating Backup automaticallyCreating Backup automatically

And their files with the imported sharing settings can be accessed through the Documents module.

Creating Backup automaticallyCreating Backup automatically

Host ONLYOFFICE Workspace on your own server

Article with the tag:
Browse all tags