Database Backup

There are two ways to do direct backups of the database: automatic and manual. In addition, the original source data files may be saved.

Automatic Backups

Automatic backups are configured through the administration web UI. When enabled, the backups are generated in subdirectories of the configured Backup Location named for the time of backup.

If the backup location is configured as:
/data/rtda/db_backup/vnc
The backup started on August 21st, 2016 at 1:00AM will be located in:
/data/rtda/db_backup/vnc/20160821_010000

Manual Backups

Manual backups are generated by running the vovdb_util utility. Backups are generated directly in the directory specified; it is recommended to specify the time of backup in the directory name for future reference. Example:
% vovdb_util backup /data/backup/vnc/2016Aug22_10AM

Source Data Backups

In addition to backing up the database directly, the source data files used to populate the database can be saved. The source files are located in vnc.swd/data and can be used to rebuild a database from scratch. No utility is provided to save these files.

Restore a Database from Backups

The procedure to restore from backup is the same whether the backup was generated automatically or manually.

  1. Ensure the current database is stopped, either through the web UI or via the command line.
  2. Delete or move the existing database.
    For example, if the database is located at /data/rtda/db/vnc, it can be moved with:
     % mv /data/rtda/db/vnc /data/rtda/db/vnc.bad 
  3. Copy or move the backup to the original database location.
    # Using the example of an automatic backup from above.
    % mv /data/rtda/db_backup/vnc/20160821_010000 /data/rtda/db/vnc
    
    # Using the example of a manual backup from above.
    % mv /data/backup/vnc/2016Aug22_10AM /data/rtda/db/vnc
  4. Restart the database.

Rebuild a Database from Source Data Files

  1. Ensure the current database is stopped, either through the web UI or via the command line.
  2. Delete or move the existing database.
    For example, if the database is located at /data/rtda/db/vnc, it can be moved with:
    % mv /data/rtda/db/vnc /data/rtda/db/vnc.bad
  3. Reload the source data files.
    % vovproject enable vnc
    % cd `vovserverdir -p data/jobs`
    % vovsql_load_jobs *