Back up a Database Cluster

This page walks you through the steps to back up your database cluster. The process also applies to single-server instances.

Backing up a cluster is an online operation. Your database remains available during the backup.

This page describes the gadmin-based Backup and Restore tool which offers improved stability and performance compared to the original GBAR (Graph Backup and Restore tool. GBAR remains available.

1. Gadmin backup subcommands:

~$ gadmin backup -h
Back up a cluster

Usage:
  gadmin backup [flags]
  gadmin backup [command]

Description:
  Back up and restore a cluster

Available Commands:
  create      Create a cluster backup
  list        List backups
  remove      Remove backup
  restore     Restore a cluster from backup

Flags:
  -h, --help   help for backup

Global Flags:
      --debug   enable debug log output to stdout

Use "gadmin backup [command] --help" for more information about a command.

2. Prerequisites

  • You have access to the TigerGraph Linux user account on your cluster. All commands must be run from the TigerGraph Linux user.

  • You have provided valid configurations for database backup.

3. Procedure

3.1. Data backup

To back up a database cluster, run the following command :

$ gadmin backup create <tag>

Replace <tag> with a custom tag for the backup. A timestamp is suffixed to the tag you provided to form the full tag of the backup. If no tag is provided, the system uses the default backup followed by the timestamp when the backup is created as the tag for the backup.

For example, run the following command to create a backup for a database cluster:

$ gadmin backup create weekly

This creates a backup file named weekly-<timestamp> at the backup location you configured.

$ gadmin backup create weekly
[   Info] [Wed Oct 26 08:51:24 UTC 2022] Tag is weekly-2022-10-26T085124
[   Info] [Wed Oct 26 08:51:24 UTC 2022] Backup timeout is 18000 seconds
[   Info] [Wed Oct 26 08:51:24 UTC 2022] Backup path: /home/tigergraph/backup/weekly-2022-10-26T085124
[   Info] [Wed Oct 26 08:51:24 UTC 2022] Staging path: /home/tigergraph/tigergraph/data/backup/weekly-2022-10-26T085124 (shared: false)
[   Info] [Wed Oct 26 08:51:24 UTC 2022] Created backup directories
[   Info] [Wed Oct 26 08:51:24 UTC 2022] Begin to check needed disk space...
[   Info] [Wed Oct 26 08:51:24 UTC 2022] Exporting GSQL data... (async)
[   Info] [Wed Oct 26 08:51:24 UTC 2022] Exporting GUI data... (async)
[   Info] [Wed Oct 26 08:51:24 UTC 2022] Exporting GPE data... (async)
[   Info] [Wed Oct 26 08:51:25 UTC 2022] GUI exported
[   Info] [Wed Oct 26 08:51:25 UTC 2022] GSQL exported
[   Info] [Wed Oct 26 08:51:25 UTC 2022] GPE exported
[   Info] [Wed Oct 26 08:51:27 UTC 2022] Exporting GSE data... (async)
[   Info] [Wed Oct 26 08:51:28 UTC 2022] GSE exported
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculating the raw size of the exported data...
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the raw size of GSE_2_1
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the raw size of GSQL
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the raw size of GPE_1_1
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the raw size of GPE_2_1
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the raw size of GUI
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the raw size of GSE_1_1
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Archiving exported data...
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Archiving GUI data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Archiving GSE_2_1 data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Archiving GSE_1_1 data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Archiving GPE_2_1 data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Archiving GPE_1_1 data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Archiving GSQL data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculating the file size of the archives...
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the file size of GSQL.tar.lz4 data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the file size of GSE_2_1.tar.lz4 data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the file size of GPE_2_1.tar.lz4 data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the file size of GUI.tar.lz4 data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the file size of GSE_1_1.tar.lz4 data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Calculate the file size of GPE_1_1.tar.lz4 data
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Backup completes, backup files are under the path: /home/tigergraph/backup/weekly-2022-10-26T085124
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Clean staging directory: /home/tigergraph/tigergraph/data/backup/weekly-2022-10-26T085124
[   Info] [Wed Oct 26 08:51:28 UTC 2022] Clean staging directory /home/tigergraph/tigergraph/data/backup/weekly-2022-10-26T085124 successfully

4. List Backup Files

gbar backup 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, its size in human-readable format, and its creation time.

$ gadmin backup list
+--------------------------+----------+---------------------+
|           TAG            |  SIZE    |     CREATED AT      |
+--------------------------+----------+---------------------+
| weekly-2022-10-22T133912 | 2.6 MB   | 2022-10-22 13:39:12 |
| weekly-2022-10-23T133941 | 20.6 MB  | 2022-10-23 13:39:41 |
| weekly-2022-10-24T134133 | 80.1 MB  | 2022-10-24 13:41:33 |
| weekly-2022-10-25T134242 | 102.3 MB | 2022-10-25 13:42:42 |
+--------------------------+----------+---------------------+

5. Remove a backup

To remove a backup, run the gadmin backup remove tag [tag…​] command:

$ gadmin backup remove <backup_tag>

The command removes a backup from the backup storage path. To retrieve the tag of a backup, you can use the gbar list command.

5.1. Metadata backup (Optional)

This step is only necessary if you are planning for an event where you need to restore the backup in another cluster.

Run the following command to create a backup for the metadata of a particular backup:

$ gadmin backup list <backup_tag> --meta

This produces a file called metadata in the current path where the command is run. Store this file in a secure location. This file is required to restore the backup in another database cluster.