NovaStar Program Reference / Database / nsdbbackup


Overview

The nsdbbackup program creates a backup of the NovaStar database. See also the nsdbrestore program to restore a backup.

The program is typically run as a scheduled process nightly on each NovaStar node to back up the PostgreSQL database. The backup files are then copied to a location where they are retained for some time such as physical media, local network storage, or cloud storage. It is not sufficient to run nsdbbackup and leave the backups on the same machine because failure of the hard drive on that machine will cause the backups to be lost.

nsdbbackup can also be run as the root user to backup up the database at any time, for example to restore to a new machine being configured for replication (see nsdbrestore).

TODO smalers 2017-07-06` Need to make sure best practices are documented and referenced from the FWS Administrator documentation. How do we test that backups are working completely and will allow a database restore?

Command Line Usage

The command line syntax is:

nsdbbackup [parameters] backupfilename

Command line parameters are:

Parameter             Description Default
-F=c|t|p
--format=c|t|p
Backup file format:
  • c - custom (PostgreSQL) format
  • t - tar
  • p - plain text
c
-help
--help
Print usage.
backupfilename Name of the backup file. TODO smalers 2017-07-06 recommend convention and explain where created. Should an absolute path be used or relative? ?

Examples

Backup the database to a file named database.bak:

***TODO smalers 2017-11-29 explain where the backup file is created.

TODO smalers 2017-07-06 need to use an example that is real, including location of backup file. Should zipping and Amazon S3 (or other cloud option) be mentioned?

nsdbbackup database.bak

Program output:

Backup database from localhost to database.bak started...
pg_dump: reading schemas
pg_dump: reading user-defined tables
pg_dump: reading extensions
pg_dump: reading user-defined functions
pg_dump: reading user-defined types
pg_dump: reading procedural languages
pg_dump: reading user-defined aggregate functions
pg_dump: reading user-defined operators
... etc ...

NovaStar Administrator Interface

TODO smalers 2017-07-06 need a screenshot saved to nsdbbackup-images folder.

Troubleshooting

The program does not create a log file. To create a log file to capture standard output and standard error streams, run similar to:

nsdbbackup database.bak &> nsdbbackup.log

TODO smalers 2017-07-06 need to insert specific troubleshooting items.

See Also

  • nsdbrestore - program to restore database from backup