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


In some cases, you may wish to switch to a new CubeBackup instance on a new server and point it to the data backed up by your old server. For example, if you have upgraded your server or if your old server crashed, you may want to install a new CubeBackup instance based on your existing backups.

Please follow the guide below to set up CubeBackup on the new server:

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

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.

Please run this command.

sudo /opt/cubebackup/bin/cbsrv stop

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

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

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

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

Please run this command to stop the container.

sudo docker stop <container-name>

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:

cbackup syncDataIndex

NOTE: This command requires special priviledges.

On Linux or Docker: this command must be run by cbuser.

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

On Windows: Open the Command Prompt or Windows PowerShell and run this command as Administrator

"C:\Program Files\CubeBackup4\bin\cbackup.exe" syncDataIndex

Step 3. Install CubeBackup on the new server.

Download CubeBackup for Google Workspace and install it on the new Server/VM.

Notes:
1. Please DO NOT start the CubeBackup configuration in the setup wizard until you have completed Step 4 in this document.
2. Ensure the old and new servers are running the same version of CubeBackup. If needed, perform an in-place upgrade on the old server and run a few backups before server migration, 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 5. Go through the setup wizard on the new server

  • Restart the CubeBackup service 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>

  • Open or refresh the CubeBackup web console and launch the initial setup wizard. Confirm that it points to your original backups, and modify the data index location if necessary.

    Tips:
    1. There is no need to copy the original data index from the old server. CubeBackup will generate a new data index on the new server.
    2. For original backups stored on a local disk, please ensure that it is accessible to the new server in the same storage path as before.

  • Click Next in the setup wizard. You do not need to upload the service account key file. Simply input the original domain name and domain administrator, then click Next all the way to the final step.

  • Before logging in to the CubeBackup web console for the first time on the new server, create a CubeBackup admin account.

Step 6. Check if CubeBackup is functioning well

Now go back and log in to the new CubeBackup web console. All of your old backup data and backup histories should be displayed on the new server. If necessary, please try restoring a file or message to confirm. Subsequent backups will be incrementally processed based on the old backup data.