- Home
- Workspace
- Administration
- Using Control Panel
- Migrating Nextcloud data to ONLYOFFICE Workspace
Migrating Nextcloud data to ONLYOFFICE Workspace
Introduction
This article describes how to transfer 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 you to export data from the Nextcloud installation folder and MySQL database. To activate the maintenance mode:
- Go to the folder with the Nextcloud installation.
cd /var/www/html/nextcloud - Run the
occfile to enable the maintenance mode.sudo -u www-data php occ maintenance:mode --onDepending 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, you need to include the users' folders in the 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 the destination of the exported folder.
Exporting the database
You also need to export the MySQL backup file. There are two possible ways of dumping the database.
If the database is deployed on the same server, run:
sudo mysqldump --lock-tables -u root -p nextcloud_db > [preferred location]/nextcloud-dirbkp_`date +"%Y%m%d"`/
Where [preferred location] is the 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, you can disable the maintenance mode and start the Nextcloud server.
To do that, go to the Nextcloud installation folder and run:
sudo -u www-data php occ maintenance:mode --off
Prepare the data for import
To import the data, you need to compress specific files and folders into 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
Import the data to ONLYOFFICE Workspace
- Sign in to your ONLYOFFICE Workspace.
- Go to the Control Panel.
- Select the Data import option in the PORTAL SETTINGS section.
- Click INITIALIZE IMPORT in the Nextcloud section.
- Click the Plus button next to the selection box and select the archive.zip file.
Wait for the archive to load. When the loading is complete, click UPLOAD TO SERVER.
- Select the users to be imported into ONLYOFFICE and click NEXT STEP. In this step, only users with emails will be migrated.
- In this step, you can select users without specified emails, complete their email addresses, and migrate them to your portal. To do that, enter the user's email address and click the Tick button next to the email text box. Select multiple users from the list by selecting the users' checkboxes. Proceed to the next step by clicking NEXT STEP.
There is also an option to download the unimported users by clicking DOWNLOAD UNIMPORTED USERS.
- Select the modules for import. The data will appear in the corresponding modules of ONLYOFFICE. Click START DATA IMPORT to proceed to the final step.
- After the data is migrated, click FINISH to complete the data import.
Optionally, you can send a welcome letter to the imported users. This letter informs your Nextcloud users about the migration to ONLYOFFICE Workspace. It contains a brief description of the main features and a login link. To send the letter, select the Send Welcome Letter option before clicking FINISH.
After the migration is complete, the new users can be found in the People module.
Their files with the imported sharing settings can be accessed through the Documents module.