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 S3 backups.

Use the vbr backup task to perform a full backup, which must be to a location on S3. The Backup/Restore an Eon Mode Database (eon_backup_restore.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; it does not, for example, 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.

You use the same vbr task, backup, as you do for other backups. The differences are in the configuration. The Full Hardlink 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. (Eon Mode does not support object backups.)

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 from a Full or Object-Level Backup 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. You might do this to copy data from a production database to a test database to investigate a problem in isolation, for example. Or you might do a large data load in one database and then push it out to others; replication can be more efficient than repeating the load in the second 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.