How to move the data index to another location.

What is the data index?

The data index in CubeBackup acts as a cache to speed up the backup process. It contains a part of the metadata for your backup, including SQLite database files, configuration files, and other information used in the backup process. For more information about the data index, please refer to What is the data index and why is it needed?

In some scenarios, you may need to move the data index to a new place. For example:

  • The partition where the data index is stored is nearly full. You need to move the data index to a larger partition.

    If you run out of space on your CubeBackup EC2 instance - perhaps because the data index has grown beyond your initial parameters - it is easy to extend the volume size without detaching the volume or migrating the data index. For detailed instructions, you can follow the steps in Method 2.

  • In the initial configuration, you placed the data index on an HDD or network storage, which slows down your backups. Now you decided to move the data index to an SSD.

Fortunately, CubeBackup offers a simple method to move the data index to a new location:

Method 1: Regenerate the data index in a new directory.

  1. In the CubeBackup web console, stop the current backup job if one is running.

  2. On the OVERVIEW page of the CubeBackup web console, find the Storage status section at the bottom right, and click the gear icon to open the update wizard. Press the Edit storage configuration button.

  3. As a safety precaution, an authentication code will be emailed to you. Please type in the code to continue.

  4. Enter the new storage path for the data index, and click Save. CubeBackup will run a storage writing test to confirm that the new directory is valid before saving the changes and automatically regenerating the data index in it.

  5. Return to Dashboard. Now you can initiate a backup to confirm that the new data index is functioning properly.  

Method 2: Extend the volume size on an EC2 instance

For an EC2 instance, please follow the instructions below to extend the partition size of your EC2 instance:

  1. First extend the volume size in AWS console:
    • In the CubeBackup console, click Stop backup to if there is a current backup process.
    • Login to your AWS console and then select the EC2 instance on which CubeBackup is running.
    • In the Storage tab, click the Volume ID -> Actions -> Modify Volume and resize the volume to a larger size.
  2. Then you need to extend the partition itself:

    • SSH to the EC2 instance.
    • Type the following command to list the block devices:

    • You should see something similar to the example below. The size of the root volume reflects the resized space (20GB) and the size of the partition reflects the original size (8GB), which must be extended before you can extend the file system. partition size

    • To do so, type the following command:

      sudo growpart /dev/xvda 1

      Carefully note that there is a space between the device name and partition number.

    • You can use the lsblk command again to check that the partition reflects the increased volume size. changed partition size

  3. (Optional) For Linux systems utilizing LVM, it is necessary to extend the physical volume on your server. If you are not using LVM, you can proceed to step 4 directly.

    You can identify the volumes belonging to a Linux system using LVM by checking for volumes with the TYPE:lvm attribute. lsblk TYPE attribute

    • Run the following command to resize the physical volume to match the new partition size, replacing /dev/sda2 with the appropriate partition.

      sudo pvresize /dev/sda2

      find logical volume

    • Find the logical volume name using the command df -h. You can compare the output with lsblk to double-check the logical volume you need to extend. find logical volume

    • Extend the logical volume to use all available free space by running the following command. Please replace <lv_name> with the actual logical volume name.

      sudo lvextend -r -l +100%FREE <lv_name>

      find logical volume

  4. Last but not least, you need to extend the filesystem itself:

    • Use the following command for ext2,ext3 or ext4 file systems:

      sudo resize2fs /dev/xvda1
    • For an XFS file system, use the command below:

      sudo xfs_growfs /dev/xvda1
    • You can check the extended filesystem with:

      df -h
  5. If everything goes smoothly, you will see that the partition size has changed in the CubeBackup web console. extended file system