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-fh, 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):

    /opt/hw-fh/bin/full-backup
    
  3. Enter Y on N (Yes or No) to confirm backup creation;

  4. Ready backup will be saved to /opt/hw-fh_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-fh/config/user.ini (root privileges required);
  2. Add the following line to the [main] section and specify number of backups (integer):

    [main]
    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-fh
    
  2. Make a backup of the current Platform state (optional step):

    mv /opt/hw-fh /path/to/your/safe/place
    
  3. In the directory /opt/hw-fh_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-fh, example:

    mkdir -p /opt/hw-fh
    tar -xzf /opt/hw-fh_backup/backup_2022.09.21T10.31.32Z.tgz -C /opt/hw-fh
    
  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-fh/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_fh_en-US_<version>.run --noexec --target /new/directory
    
  7. Load images of the installation files:

    cd /new/directory
    bash load-images.sh
    
  8. Restore daemon systemctl configurations:

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

    . /opt/hw-fh/bin/common-functions.sh && create_user_group
    
  10. Start the Platform:

    systemctl start hw-fh
    

See also