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.

On Linux:

 sudo /opt/cubebackup/bin/cbsrv stop

On Windows:

Enter services.msc in the command line, then in the Services list that pops up, right-click the CubeBackup Service entry, and select Stop.

In Docker container:

 sudo docker stop <container-name>

Step 2. Install CubeBackup on the new server.

Download CubeBackup from https://www.cubebackup.com and install it on the new Server/VM.

Note: Please install the CubeBackup software without configuring it. On windows, you can close the configuration wizard that pops up after installation.

Step 3. Copy configuration files from the old server to the new server.

Copy all files in “<cubebackup installation directory>/db” from the old server to the same location on the new server.

If the new server is a Linux server, you also need to change the owner of the “<cubebackup installation directory>/db” directory to cbuser. For example:

sudo chown -R cbuser:cbuser /opt/cubebackup/db

Step 4. Edit the storage.json file if needed.

Manually open the “<cubebackup installation directory>/db/storage.json” file on the new server in a text editor and check whether any values need to be modified and modify accordingly.

Tips:

  • In most cases, there is no need to modify the storage.json file, because the original values should be correct by default.
  • For detailed information about the storage.json file, please refer to Configuration Guide: storage.json.

Step 5. Create data index directory with proper permissions (This step is only necessary on a Linux server).

If the new server is a Windows machine, please skip directly to Step 6.

If the new server is a Linux server, you need to manually create a directory for the data index.

sudo mkdir -p /opt/cubebackup/index

Note:
The data index directory is defined in the /opt/cubebackup/db/storage.json file. So, please ensure that the directory path you created is same as the value of IndexPath in the storage.json file.

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

sudo chown cbuser:cbuser /opt/cubebackup/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 6. Restart the CubeBackup service on the new server.

On Linux:

sudo /opt/cubebackup/bin/cbsrv restart

On Windows:

Enter services.msc in the command line, then in the Services list that pops up, right click the CubeBackup Service entry, and select Restart.

On Docker:

sudo docker restart <container-name>

Step 6. Check if CubeBackup is functioning well

Now go back and log into the new CubeBackup web console using the username and password from the old server.

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.