RESTORE (bSQL) | Blockpoint Docs
Restores bSQL database backups taken using the BACKUP command. For examples, see Examples.
Syntax​
RESTORE <database_object>
FROM "filepath"
[[key =] key_name]
<database_object> ::=
database_name
| database_name.blockchain_name
Arguments​
database_name
The name of the database to be restored.
blockchain_name
The name of the blockchain to be restored.
filepath
The filepath to restore the object from.
key_name
The key to used to decrypt the file.
NOTE: The user must have access to the decryption key additionally it must be the same key used to encrypt the BACKUP.
[!IMPORTANT] Encrypted backups aren't currently supported, therefore there is no need to specify a decryption key.
Usage​
BACKUP and RESTORE commands should be used to revert corrupted files to their most recent uncorrupted backup.
Scenarios​
This command enables you to perform the following restore scenarios:
- Restore an entire database from a full database backup (a complete restore).
- Restore part of a database (a partial restore).
Permissions​
MANAGEMENT
permission required on the target blockchain.
MANAGEMENT
permissions default to members of the admin and developer fixed database roles. Members of the admin role can transfer permissions to other users.
Examples​
A. Restoring a database.​
The following example restores the financial
demo database database, rolling back any uncommitted transactions and updating the current state of the database to the filepath referenced.
RESTORE financial
FROM "financial_backup.zip"
B. Restoring a blockchain container.​
The following example restores the companies
blockchain from the financial
demo database, rolling back any uncommitted transactions and updating the current state of the blockchain to the filepath referenced.
RESTORE financial.companies
FROM "companies_backup.zip"