×

☰ Table of Contents

TigerGraph Docs : GBAR - Graph Backup and Restore v1.0

Backup and Restore

Updated:

Introduction and Syntax

GBAR (Graph Backup And Restore), is an integrated tool for backing up and restoring the data and data dictionary (schema, loading jobs, and queries) of a single TigerGraph node at any time. In Backup mode, it packs TigerGraph data and configuration information in a single file onto disk or a remote AWS S3 bucket. Multiple backup files can be archived. Later, you can use the Restore mode to rollback your system to any backup point. This tool can also be integrated easily with Linux cron to perform periodic backup jobs.

Synopsis
Usage: gbar backup [options] -t <backup_tag> gbar restore [options] <backup_tag> gbar config gbar list Options: -h, --help show this help message and exit -v Run with debug info dumped -vv Run with verbose debug info dumped -y Run without prompt -t BACKUP_TAG Tag for backup file, required on backup


The -y option forces GBAR to skip interactive prompt questions by automatically selecting the "yes" (default) answer. There are currently four situations for prompts:

  • During backup, if GBAR calculates there is insufficient disk space to copy and then compress the graph data, it will ask: Do you want to continue?(y/N)
  • At the start of restore, GBAR will always asks if it is okay to turn off and reset the TigerGraph services: (y/N)?
  • During restore, if user does not provide the backup_tag with a full backup file name in command line, and there are multiple files matching that tag, it by default choose the latest, and will ask: Do you want to continue?(y/N)
  • During restore, if GBAR calculates there is insufficient disk space to copy the current graph data and then uncompress the archived data, it will ask: Do you want to continue?(y/N)

Config

gbar config

GBAR Config must be run before using GBAR backup/restore functionality. GBAR Config will open the following configuration template interactively in a text editor. Using the comments as a guide, edit the configuration file to set the configuration parameters according to your own needs.

Synopsis
# Configure file for GBAR # you can specify storage method as either local or s3, or both # Assign True if you want to store backup files on local disk # Assign False otherwise, in this case no need to set path store_local: False path: PATH_TO_BACKUP_REPOSITORY # Assign True if you want to store backup files on AWS S3 # Assign False otherwise, in this case no need to set AWS key and bucket store_s3: False aws_access_key_id: YOUR_ACCESS_KEY aws_secret_access_key: YOUR_SECRET_KEY bucket: YOUR_BUCKET_NAME

Backup

gbar backup -t <backup_tag>

GBAR Backup performs a live backup, meaning that normal operations may continue while backup is in progress. When GBAR backup starts, it sends a request to GADMIN, which then requests the GPE and GSE to create snapshots of their data. Per the request, the GPE and GSE store their data under GBAR’s own working directory. GBAR also directly contacts the Dictionary and obtains a dump of its system configuration information. Then, GBAR compresses all the data and configuration information into a single file named <backup_tag>-<timestamp>.tgz. As the last step, GBAR copies that file to local storage or AWS S3, according to the Config settings, and removes all temporary files generated during backup.

The current version of GBAR Backup takes snapshots quickly to make it very likely that all the components (GPE, GSE, and Dictionary) are in a consistent state, but it does not fully guarantee consistency.

Backup does not save input message queues for REST++ or Kafka.

Restore

gbar restore <backup_tag>

Restore is an offline operation, requiring the data services to be temporarily shut down. When GBAR restore begins, it first searches for a backup file matching the backup_tag supplied in the command line. If the backup_tag is not a full backup file name, GBAR will by default select the latest one, and ask the user for confirmation to continue. Then it decompresses the backup file to its own working directory. It will then turn off the TigerGraph servers (GSE, RESTPP, etc.) temporarily. Then, GBAR makes a copy of the current graph data, as a precaution. If GBAR estimates that there is not sufficient disk space for the copy, GBAR will display a warning and prompt the user to abort (unless the user has overridden the prompt with the -y option). Next, GBAR copies the backup graph data into the GPE and GSE and notifies the Dictionary to load the configuration data. When these actions are all done, GBAR will restart the TigerGraph servers.

In order to succeed, Restore needs enough free space to accommodate both the old gstore and the gstore to be restored.

List Backup Files

gbar list

This command lists all generated backup files in the storage place configured by the user. For each file, it shows the file’s full tag, file’s size in human readable format, and its creation time.