How to set up a new CubeBackup for Google Workspace 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 Google Workspace 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/cubebackup/bin/cbsrv stop

Step 2. Merge the data index cache to backup storage on the old server.

Run the following command to merge the CubeBackup data index to your backup storage.

On Linux, this command requires special priviledges and must be run by cbuser.

sudo -u cbuser /opt/cubebackup/bin/cbackup syncDataIndex

Step 3. Install CubeBackup on the new server.

Install CubeBackup for Google Workspace on a new server or VM.

Notes:
1. Please DO NOT begin the CubeBackup configuration in the setup wizard until Step 4 in this document has been completed.
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 4. Copy configuration files to the new server.

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

  • <installation directory>/db/license
  • <installation directory>/db/storage.json
  • <installation directory>/db/config.json
  • <installation directory>/db/keys.json
  • <installation directory>/db/jwt.json
  • <installation directory>/etc/config.toml OR <installation directory>/bin/config.toml

Tips:
1. By default, the installation directory is C:\Program Files\CubeBackup4 on Windows and /opt/cubebackup on Linux.
2. 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/cubebackup/db
sudo chown -R cbuser:cbuser /opt/cubebackup/etc

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\CubeBackup4\bin\cbsrv.exe" stop # in Command Prompt 
    
    & "C:\Program Files\CubeBackup4\bin\cbsrv.exe" stop # in Windows Powershell 
    

Step 2. Merge the data index cache to backup storage.

Please run the following command to merge the CubeBackup data index to your backup storage.

"C:\Program Files\CubeBackup4\bin\cbackup.exe" syncDataIndex # in Command Prompt 
& "C:\Program Files\CubeBackup4\bin\cbackup.exe" syncDataIndex # in Windows Powershell 

Step 3. Install CubeBackup on the new server.

Install CubeBackup for Google Workspace on a new server or VM.

Notes:
1. Please DO NOT begin the CubeBackup configuration in the setup wizard until Step 4 in this document has been completed.
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 4. Copy configuration files from the old server to the new server.

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

  • <installation directory>/db/license
  • <installation directory>/db/storage.json
  • <installation directory>/db/config.json
  • <installation directory>/db/keys.json
  • <installation directory>/db/jwt.json
  • <installation directory>/etc/config.toml OR <installation directory>/bin/config.toml

Tips:
1. By default, the installation directory is C:\Program Files\CubeBackup4 on Windows and /opt/cubebackup on Linux.
2. 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/cubebackup/db
sudo chown -R cbuser:cbuser /opt/cubebackup/etc

Step 1. Switch the CubeBackup container to maintenance mode.

  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. Once confirmed, switch the CubeBackup container to maintenance mode using the following command:

    docker exec <container_id> touch /cubebackup_maintenance && docker restart <container_id>

Step 2. Merge the data index cache to backup storage on the old server.

  1. Open the bash shell of the container.

    docker exec -it <container_id> bash
  2. Run the cbackup syncDataIndex command as cbuser.

    sudo -u cbuser /opt/cubebackup/bin/cbackup syncDataIndex
  3. Exit and stop the old container.

    exit
    docker stop <container_id>

Step 3. 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 until Step 4 in this document has been completed.
2. Ensure 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 imageto start the new CubeBackup container.

Step 4. Copy configuration files to the new container.

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

    • <installation directory>/db/license
    • <installation directory>/db/storage.json
    • <installation directory>/db/config.json
    • <installation directory>/db/keys.json
    • <installation directory>/db/jwt.json
    • <installation directory>/etc/config.toml

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

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

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

    docker exec -it <container_id> bash
    sudo chown -R cbuser:cbuser /opt/cubebackup/db
    sudo chown -R cbuser:cbuser /opt/cubebackup/etc
    exit

Step 5. Go through the setup wizard on the new server

  1. Restart the CubeBackup service on your new server using the following command.

    Please run this command.

    sudo /opt/cubebackup/bin/cbsrv restart

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

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

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

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

    Please run this command to restart the container.

    sudo docker restart <container-name>

  2. Open or refresh the CubeBackup web console and launch the initial setup wizard.

  3. In step 2, confirm that the storage location points to your original backups. Modify the data index location if necessary, then click Next.

    Tips:
    1. There is no need to copy the original data index from the old server. CubeBackup will automatically generate a new data index on the new server.
    2. If the original backups are stored on a local disk or NAS, ensure the disk or network storage is accessible to the new server using the same storage path as before.

  4. In step 3, there is no need to upload the service account key file. Simply input the original domain name and domain administrator, then proceed by clicking Next through to the final step.

  5. In the last step, create a new CubeBackup admin account before logging in to the CubeBackup web console for the first time.

Step 6. 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.