Restore Database

This is a NuoDB Manager command. See NuoDB Manager.


Create a NuoDB database from an existing archive and journal directory on disk. This is useful for performing a restore from a point-in-time backup.

The restore database command simply takes a database name and assumes that database archive and journal directory exist in the default archive directory for the host (specified with the HOST variable), as specified by the default_archive_base and default_journal_base system-defined host tags, and modifiable by the host tags archive_base and journal_base. The database that is created by restore database is always a Single Host database created on the host specified by the HOST variable. If the restore database command does not find the journal directory in the expected location, it will issue a helpful error and the user will have to intervene to move the journal directory to the expected location. The following is an example of that error:

The journal directory is expected to be [/home/jdoe/archives/db1] but it was found at [/home/jdoe/archives/db1/journal].
You can repair this by moving the contents of [/home/jdoe/archives/db1/journal] into [/home/jdoe/archives/db1] on host [jdoe-mbp]


restore database
    dbname database_name 
    [ timeout timeout_value ]
    [ options option_list  ]
    [ variables variable_list ]
    [ groupOptions:groupName option_list ]...
    [ tagConstraints:groupName constraint_list ]...


Interactive Example

Restore a database from an existing archive and journal directory.

nuodb [domain] > restore database
Database Name: backupdb

Database Options (optional): commit remote:1 mem 2g
Timeout (ms/s/m/h/d/w) (optional): 
Database Options for SMs (optional): journal-max-directory-entries 500
Tag Constraints for SMs (optional):    
Database Options for TEs (optional): verbose sql-statements
Tag Constraints for TEs (optional): 

Scripting Example

The same restore database command can be executed with --command as follows:

$ nuodbmgr --broker host --password password \
    --command "restore database dbname backupdb \
    options 'commit remote:1 mem 2g' \
    variables 'HOST ip-172-31-40-24' \
    groupOptions:SMs 'journal-max-directory-entries 500' \
    groupOptions:TEs 'verbose sql-statements'"