NovaStar Program Reference / Database / nsdbrestore


Overview

The nsdbrestore program restores a NovaStar database backup created with the nsdbbackup program. The program is used to restore the database from a backup due to a system failure and can also be used to facilitate copying the NovaStar database from the master node to a new backup/slave node when initializing replication on the new backup/slave node.

When a system already implements replication and failover has occurred, nsdbrestore should not be used to restore the database. Instead it is better to restore replication and let the backup and slave databases catch up (nsdbrestore would change the configuration, serial port, and scheduler tables, which are not replicated).

The nsdbbackup and nsdbrestore programs can be used to recover from a catastrophic failure. They should not be used during NovaStar5 updates (the original database can be before and after the update). A typical PostgreSQL database backup should be performed before an operating system upgrade because the PostgreSQL software will change - then use normal PostgreSQL restore to restore the old backup. TODO smalers 2017-11-29 does this sentence mean to not use nsdbbackup/nsdbrestore?

The program should be run as root. The NovaStar system is shutdown as part of the script. When a system is replicated, the master database backup is made with nsdbbackup, it is copied to the backup node with scp, then restored with nsdbrestore. TODO smalers 2017-11-29 Need to clarify the above statement.

Command Line Usage

The command line syntax is:

nsdbrestore [parameters] backupfilename

Command line parameters are:

Parameter             Description Default
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? ?
-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.
-h hostname Hostname for the database to back up. localhost
-q
-quiet
--quiet
Run quietly - do not display activity messages.
-version
--version
Display the program version.

Examples

TODO smalers 2017-11-29 Need to show example of restore, including recommended filename and location to run the restore, saving to a log file to allow review.

Scheduling

This command is not run on a schedule, although nsdbbackup should be run on a schedule.

NovaStar Administrator Interface

Database restoration is usually not performed via the Administrator because the restoration process will disrupt Administrator functionality.

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:

nsdbrestore database.bak &> nsdbrestore.log