Verifying backed up and restored data

To help ensure that your backup was created correctly and completely, consider verifying the backup folder contents.

Because backups created with the validate_backup command start when the inactive state is triggered by the script, consider using Method 1: Verify using metadata to help ensures the integrity of data and avoid discrepancies caused by manual comparisons between the original server and the server where the backup is restored.

Method 1: Verify using metadata

When you create a backup for a project, the backup archive includes a MANIFEST.json file that contains metadata about the backup (such as defect counts and project details).

When you restore the project to a server, a new MANIFEST.json file is created in the logs/restoreLogs folder of the target server.

To confirm that the backup is complete, compare the MANIFEST.json file from the backup archive to the file generated after the restore. If the metadata matches, the restore is successful.

Method 2: Verify using checksums

A checksum is a unique identifier that can confirm whether the backup data has been altered or corrupted.

You can compare the checksum of the backup folder with the checksum of the restored folder.

Creating checksums on Windows

To create a checksum of your backup folder on Windows, you can use a tool such as Certutil in a PowerShell script. For example:

Get-ChildItem -Recurse -File "C:\path\to\backup" | ForEach-Object {
    $hash = Get-FileHash -Path $_.FullName -Algorithm SHA256
    "$($hash.Hash)  $($_.FullName)"
} > checksums.txt

Creating checksums on Linux

To create a checksum of your backup folder on Linux, you can use a tool such as md5sum in a loop. For example:

 find /path/to/backup -type f -exec md5sum {} \; > checksums.txt

Comparing checksums

  1. Create a checksum of the backup folder.
  2. Restore the backup folder.
  3. Create a checksum of the folder that you restored.
  4. Compare the two checksum values. If they match, the restore is successful.