Platform backups

If you want to keep your data safe and sound, create backups to avoid potential data loss. Backups contain all data that is stored in the directory /opt/hw-bw, including personal Platform settings in user.ini file.

Note: backups are automatically created during the installation of platform updates.

Create Platform Backup

To create platform backup, perform the following steps:

  1. Open the console of the virtual machine;
  2. Run the command (root privileges required):

  3. Enter Y on N (Yes or No) to confirm backup creation;

  4. Ready backup will be saved to /opt/hw-bw_backup.

Note: old backups will be deleted, if the limit of the stored backups is exceeded.

Additional options:

  • --force / -f - make a backup without an additional question;
  • --help / -h - brief documentation about backup options;
  • backup_depth - number of the stored backups (integer, by default is 3). If it is not set, the value is taken from the product.backup.depth option in the user.ini file.

To change the number of backups stored on the Platform:

  1. Open file /opt/hw-bw/config/user.ini (root privileges required);
  2. Add the following line to the [main] section and specify number of backups (integer):

    product.backup.depth = 3

Restore data from backup

To restore data from backup, perform the following steps:

Note: if you restore data from backup on a new (clean) virtual machine, start from the 3rd step. First two steps are needed if you restore data on the virtual machine with Platform installed.

  1. Stop the Platform if it is running (root privileges required):

    systemctl stop hw-bw
  2. Make a backup of the current Platform state (optional step):

    mv /opt/hw-bw /path/to/your/safe/place
  3. In the directory /opt/hw-bw_backup, find Platform backup you want to restore and copy it to any directory on the virtual machine;

  4. Unpack the backup to the directory /opt/hw-bw, example:

    mkdir -p /opt/hw-bw
    tar -xzf /opt/hw-bw_backup/backup_2022.09.21T10.31.32Z.tgz -C /opt/hw-bw
  5. Upload Platform installation files of the version that was installed at the moment when you created a backup to the server. To check Platform version, run the command:

    /opt/hw-bw/bin/get-config-value product.version

    Note: if you don't have needed Platform version, contact HexWay team.

  6. Unpack Platform installation files:

    bash ./install_hw_bw_en-US_<version>.run --noexec --target /new/directory
  7. Load images of the installation files:

    cd /new/directory
  8. Restore daemon systemctl configurations:

    systemctl link /opt/hw-bw/systemd/hw-bw.service
    systemctl enable hw-bw
    systemctl daemon-reload
  9. If you restore backup on a new (clean) virtual machine, you should also add a group and user:

    . /opt/hw-bw/bin/ && create_user_group
  10. Start the Platform:

    systemctl start hw-bw

See also