Restore a Database
ArcadeDB allows to restore a database previously backed up.
Restore via HTTP API (recommended)
The easiest way to restore a database on a running server is via the server command HTTP API. This supports both local files and remote URLs:
$ curl -X POST http://localhost:2480/api/v1/server \
-d '{"command": "restore database mydb file:///path/to/mydb-backup.zip"}' \
-H "Content-Type: application/json" \
--user root:arcadedb-password
Restoring from a remote URL (e.g., a backup hosted on a server or cloud storage):
$ curl -X POST http://localhost:2480/api/v1/server \
-d '{"command": "restore database mydb https://example.com/backups/mydb-backup.zip"}' \
-H "Content-Type: application/json" \
--user root:arcadedb-password
The database must not already exist. The server downloads the backup file, extracts it, and opens the database automatically.
For security reasons, restoring from an http:///https:// URL refuses by default to reach a local-file, loopback, link-local, or private-network address, including a redirect that lands on one. This protects the server from being made to fetch from internal-only hosts (e.g. a cloud metadata endpoint) via a crafted or hijacked backup URL. If you need to restore from a backup hosted on such an address (for example, an internal artifact server), set arcadedb.server.restoreImportAllowLocalUrls=true on the server.
|
Restore via command line
If the server is not running, you can restore a database using the command-line tool.
| If a server is running, it must be restarted in order to access a database restored via command line. |
Example
Example for restoring the database "mydb" from the backup located in backups/mysb/mydb-backup-20210921-172750767.zip.
$ bin/restore.sh -f backups/mysb/mydb-backup-20210921-172750767.zip -d databases/mydb
Configuration
-
-f <backup-file>(string) path to the backup file to restore. -
-d <database-path>(string) path on local filesystem where to create the ArcadeDB database. -
-o(boolean) true to overwrite the database if already exists. If false and thedatabase-pathalready exists, an error is thrown. Default is false.