Restoring a Database Using an Archive

On occasion, it may be desirable to start a database using an existing database archive (database on disk), for example:

  • When you want to bootstrap a test/QA environment using a copy of production data.

  • When you want to restore a database archive from a backup copy.

  • When migrating a database where the nuoagent admin tier had been used for domain and database management to an environment where NuoDB Admin (nuoadmin) is the default admin service.

To restore an existing database archive for a specific host, use the create archive command with the --restored option. It is not possible to restore into a running database. The process documented here creates a new database. When restoring a database archive, the archive must be physically mounted on the host running the NuoDB Archive specified by the --server-id argument.

nuocmd create archive --db-name <database name> --server-id <server ID> --archive-path /var/opt/nuodb/production-archives/<database name> --restored

For example, to restore an archive identified for the hockey database that physically resides on the host running the nuoadmin-1 Admin Process, run the following command:

nuocmd create archive --db-name hockey --server-id nuoadmin-1  --archive-path /var/opt/nuodb/production-archives/hockey --restored

The --restored option specifies that the archive being created already contains data, and that an SM started on it does not require the --initialize option. The hockey database can then be started by running the following commands:

nuocmd create database --db-name hockey --dba-user dba --dba-password goalie --te-server-ids nuoadmin-1
The --dba-user and --dba-password options are required when creating a database. However, in the case of creating a database from an existing archive, their values are ignored and the DBA credentials from the archive will be used.

The create archive command is issued using NuoDB Command (nuocmd). For more information on NuoDB Command and other command line tools, see Command Line Tools.