How to set up a new CubeBackup for Microsoft 365 server and connect it to the backups made by an old server.


Switching to a new CubeBackup instance on a new server is sometimes necessary, particularly if you've upgraded your server and want to continue using the backups from your previous installation. This process allows you to seamlessly resume backup and restoration tasks without starting over.

To set up CubeBackup for Microsoft 365 on your new server, please follow the detailed instructions appropriate for your operating system.

Important: Access to your original installation directory is required to complete the setup. If your old server is no longer accessible, please refer to our guide for disaster recovery: Disaster recovery of a CubeBackup instance.

Step 1. Stop the CubeBackup service on your old server.

  1. Please ensure that there are no ongoing backup tasks in the CubeBackup web console. If there are any, please stop it or wait for it to complete before proceeding to the next step.

  2. Stop the CubeBackup service using the following command:

    sudo /opt/cubebackup365/bin/cbsrv stop

Step 2. Install CubeBackup on the new server.

Install CubeBackup for Microsoft 365 on a new server or VM.

Notes:
1. Please DO NOT start the CubeBackup configuration in the setup wizard and follow the next steps in this document.
2. Ensure the old and new servers are running the same version of CubeBackup. If necessary, perform an in-place upgrade on the old server and run a few backups before the subsequent steps, or install the same old version on the new server.

Step 3. Copy configuration files to the new server.

Copy the following configuration directories from the old server to the same location on the new server:

  • <installation directory>/data/
  • <installation directory>/etc/

Tips:
1. By default, the installation directory is C:\Program Files\CubeBackup365 on Windows and /opt/cubebackup365 on Linux.
2. If you're switching between a Windows and Linux version, please remove the files <installation directory>/data/update.json and <installation directory>/data/update.zip before continuing.
3. If the new target server is Linux, please also be sure to change the owner of the <installation directory>/db and <installation directory>/etc directory to cbuser. For example:

sudo chown -R cbuser:cbuser /opt/cubebackup365/data
sudo chown -R cbuser:cbuser /opt/cubebackup365/etc

Step 4. Update the backup storage location if necessary.

If your backup storage location has changed on the new server - for instance, an updated the IP address of your network storage or a modified data index path due to different OS, it's essential to update the configuration file. Please locate the <installation_directory>/data/storage.json file on the new server, open it in a text editor and adjust the values to match the new storage settings.

For an encrypted storage.json file, you cannot edit them directly. Instead, please create a new configuration file and replace the original one by following the instructions outlined here: CubeBackup for Microsoft 365 configuration guide: storage.json.

Step 5. Create the data index directory with proper permissions

Note: This step is only necessary for a new Linux or Docker installation. If the new server is a Windows machine, please skip directly to Step 6.

Manually create a directory for the data index path. For example, if your data index was stored at /opt/cubebackup365/index on the old server,

sudo mkdir -p /opt/cubebackup365/index

After the data index directory has been created, you also need to change its owner to cbuser:

sudo chown -R cbuser:cbuser /opt/cubebackup365/index   

Note:
There is no need to copy the original data index from the old server to the new server. CubeBackup will automatically generate a new data index in the correct location as long as the data index directory has the proper permissions.

Step 1. Stop the CubeBackup service on your old server.

  1. Please ensure that there are no ongoing backup tasks in the CubeBackup web console. If there are any, please stop it or wait for it to complete before proceeding to the next step.

  2. Open a Command Prompt or Windows Powershell as Administrator and run the following command:

    "C:\Program Files\CubeBackup365\bin\cbsrv.exe" stop # in Command Prompt 
    
    & "C:\Program Files\CubeBackup365\bin\cbsrv.exe" stop # in Windows Powershell 
    

Step 2. Install CubeBackup on the new server.

Install CubeBackup for Microsoft 365 on a new server or VM.

Notes:
1. Please DO NOT start the CubeBackup configuration in the setup wizard and follow the next steps in this document.
2. Ensure the old and new servers are running the same version of CubeBackup. If necessary, perform an in-place upgrade on the old server and run a few backups before the subsequent steps, or install the same old version on the new server.

Step 3. Copy configuration files to the new server.

Copy the following configuration directories from the old server to the same location on the new server:

  • <installation directory>/data/
  • <installation directory>/etc/

Tips:
1. By default, the installation directory is C:\Program Files\CubeBackup365 on Windows and /opt/cubebackup365 on Linux.
2. If you're switching between a Windows and Linux version, please remove the files <installation directory>/data/update.json and <installation directory>/data/update.zip before continuing.
3. If the new target server is Linux, please also be sure to change the owner of the <installation directory>/db and <installation directory>/etc directory to cbuser. For example:

sudo chown -R cbuser:cbuser /opt/cubebackup365/data
sudo chown -R cbuser:cbuser /opt/cubebackup365/etc

Step 4. Update the backup storage location if necessary.

If your backup storage location has changed on the new server - for instance, an updated the IP address of your network storage or a modified data index path due to different OS, it's essential to update the configuration file. Please locate the <installation_directory>/data/storage.json file on the new server, open it in a text editor and adjust the values to match the new storage settings.

For an encrypted storage.json file, you cannot edit them directly. Instead, please create a new configuration file and replace the original one by following the instructions outlined here: CubeBackup for Microsoft 365 configuration guide: storage.json.

Step 5. Create the data index directory with proper permissions

Note: This step is only necessary for a new Linux or Docker installation. If the new server is a Windows machine, please skip directly to Step 6.

Manually create a directory for the data index path. For example, if your data index was stored at /opt/cubebackup365/index on the old server,

sudo mkdir -p /opt/cubebackup365/index

After the data index directory has been created, you also need to change its owner to cbuser:

sudo chown -R cbuser:cbuser /opt/cubebackup365/index   

Note:
There is no need to copy the original data index from the old server to the new server. CubeBackup will generate a new data index in the correct location as long as the data index directory has the proper permissions.

Step 1. Stop the CubeBackup container.

  1. Please ensure that there are no ongoing backup tasks in the CubeBackup web console. If there are any, please stop it or wait for it to complete before proceeding to the next step.

  2. Stop the CubeBackup container using the following command:

    docker stop <container-name>

Step 2. Start a new CubeBackup container.

Follow the instructions provided here to start a new CubeBackup container and mount the necessary volumes.

  • If you are migrating from an old container on the same host machine, please ensure that the original volumes are correctly mounted when creating the new container. Then, proceed directly to Step 6.
  • If you are using a new empty directories on the host machine, mount the required volumes to the directory and manually copy the files to the corresponding paths in the next step.

Notes:
1. Please DO NOT begin the CubeBackup configuration in the setup wizard and strictly follow the next steps in this document.
2. Ensure that both the old and new containers are running the same version of CubeBackup. If necessary, perform an in-place upgrade on the old container and run a few backups before the subsequent steps, or pull the same version of the old image before starting a new CubeBackup container.

Step 3. Copy configuration files to the new container.

  1. Copy the following configuration directories from the old server or container to your host machine.

    • <installation directory>/data/
    • <installation directory>/etc/

    Tip: By default, the installation directory is C:\Program Files\CubeBackup365 on Windows and /opt/cubebackup365 on Linux or in a Docker container.

  2. Upload the required files into the new container. For example,

    docker cp ./data/. <container_id>:/opt/cubebackup365/data/
    docker cp ./etc/. <container_id>:/opt/cubebackup365/etc/
  3. After uploading the files, ensure that the ownership of the directories /data and /etc within the installation directory is set to cbuser inside the container.

    docker exec -it <container-name> bash
    sudo chown -R cbuser:cbuser /opt/cubebackup365/data
    sudo chown -R cbuser:cbuser /opt/cubebackup365/etc

Step 4. Update the backup storage location if necessary.

If your backup storage location has changed on the new container - for instance, an updated mount point of your network storage or a modified data index path due to different OS, it's essential to update the configuration file. Please locate the /opt/cubebackup365/data/storage.json file inside the new container, open it in a text editor and adjust the values to match the new storage settings.

For an encrypted storage.json file, you cannot edit them directly. Instead, please create a new configuration file and replace the original one by following the instructions outlined here: CubeBackup for Microsoft 365 configuration guide: storage.json.

Step 5. Update data index directory with proper permissions

Manually update the ownership of the data index directory to cbuser:

sudo chown -R cbuser:cbuser /cubebackup_index   
exit

Note:
There is no need to copy the original data index from the old container to the new container. CubeBackup will automatically generate a new data index in the correct location as long as the data index directory has the proper permissions.

Step 6. Restart the CubeBackup service on the new server.

Please run this command.

sudo /opt/cubebackup365/bin/cbsrv restart

Open a Command Prompt as Administrator, and run this command.

"C:\Program Files\CubeBackup365\bin\cbsrv.exe" restart

Open the Windows PowerShell as Administrator, and run this command.

& "C:\Program Files\CubeBackup365\bin\cbsrv.exe" restart

Please run this command to restart the container.

sudo docker restart <container-name>

Step 7. Check if CubeBackup is functioning well

Now, please log in to the new CubeBackup web console.

  • Verify that all of your old backup data and backup histories is now displayed correctly.
  • Additionally, please try restoring a file or message to confirm that the new instance is functioning as expected.
  • Subsequent backups will be processed incrementally based on the existing backup data.