Common Use Cases

You can use vbr to perform many tasks related to backup and restore. The vbr Reference describes all of the tasks in detail. This section summarizes common use cases. For each of these cases, there are additional requirements not covered here. Be sure to read the linked topics for details.

This is not a complete list of Backup/Restore capabilities.

Routine Backups in Enterprise Mode

A full backup stores a copy of your data in another location—ideally a location that is separated from your database location, such as on different hardware or in the cloud. You give the backup a name (the snapshot name), which allows you to have different backups and backup types without interference. In your configuration file, you can map database nodes to backup locations and set some other parameters.

Before your first backup, run the vbr init task.

Use the vbr backup task to perform a full backup. The External Full Backup/Restore (backup_restore_full_external.ini) example provides a starting point for your configuration. For complete documentation of full backups, see Creating Full Backups.

Routine Backups in Eon Mode

For the most part, backups in Eon Mode work the same way as backups in Enterprise Mode. Eon Mode has some additional requirements described in Requirements for Eon Mode Databases, and some configuration parameters are different for backups to cloud storage. You can back up or restore Eon Mode databases that run in the cloud or on-premises using a supported cloud storage location.

Use the vbr backup task to perform a full backup. The Backup/Restore an Enterprise Mode or Eon Mode Database to Cloud Storage (backup_restore_cloud_storage.ini) example provides a starting point for your configuration. For complete documentation of full backups, see Creating Full Backups.

Checkpoint Backups: Backing Up Before a Major Operation

It is a good idea to back up your database before performing destructive operations such as dropping tables, or before major operations such as upgrading Vertica to a new version.

You can perform a regular full backup for this purpose, but a faster way is to create a hard-link local backup. This kind of backup copies your catalog and links your data files to another location on the local file system on each node. (You can also do a hard-link backup of specific objects rather than the whole database.) A hard-link local backup does not provide the same protection as a backup stored externally. For example, it does not protect you from local system failures. However, for a backup that you expect to need only temporarily, a hard-link local backup is an expedient option. Do not use hard-link local backups as substitutes for regular backups to other nodes.

Hard-link backups use the same vbr backup task as other backups, but with a different configuration. The Full Hard-Link Backup/Restore (backup_restore_full_hardlink.ini) example provides a starting point for your configuration. See Creating Hard-Link Local Backups for more information.

Restoring Selected Objects

Sometimes you need to restore specific objects, such as a table you dropped, rather than the entire database. You can restore individual tables or schemas from any backup that contains them, whether a full backup or an object backup.

Use the vbr restore task and the --restore-objects parameter to specify what to restore. Usually you use the same configuration file that you used to create the backup. See Restoring Individual Objects for more information.

Restoring an Entire Database

You can restore your complete database from a backup, either the most recent or an older one. You can restore both Enterprise Mode and Eon Mode databases, but you cannot use restore to change the mode of your database.

Use the vbr restore task to restore a database. As when restoring selected objects, you usually use the same configuration file that you used to create the backup. See Restoring a Database from a Full Backup and Restoring Hard-Link Local Backups for more information.

Copying a Cluster

You might need to copy a database to another cluster of computers, such as when you are promoting a database from a staging environment to production. Copying a database to another cluster is essentially a simultaneous backup and restore operation. The data is backed up from the source database cluster and restored to the destination cluster in a single operation.

Use the vbr copycluster task to copy a cluster. The Database Copy to an Alternate Cluster (copycluster.ini) example provides a starting point for your configuration. See Copying the Database to Another Cluster for more information.

Replicating Selected Objects to Another Database

You might want to replicate specific tables or schemas from one database to another. For example, you might do this to copy data from a production database to a test database to investigate a problem in isolation. Another example is when you complete a large data load in one database, replication to another database might be more efficient than repeating the load operation in the other database.

Use the vbr replicate task to replicate objects. You specify the objects to replicate in the configuration file. The Object Replication to an Alternate Database (replicate.ini) example provides a starting point for your configuration. See Replicating Objects to an Alternate Cluster for more information.