Restore a database dump
A database dump can be loaded to a Neo4j instance using the load
command of neo4j-admin
.
Command
The neo4j-admin database load
command loads a database from an archive created with the neo4j-admin database dump
command.
Alternatively, neo4j-admin database load
can accept a dump from standard input, enabling it to accept input from neo4j-admin database dump
or another source.
The command can be run from an online or an offline Neo4j DBMS.
If you are replacing an existing database, you have to shut it down before running the command.
If you are not replacing an existing database, you must create the database (using CREATE DATABASE
against the system
database) after the load operation finishes.
neo4j-admin database load
must be invoked as the neo4j
user to ensure the appropriate file permissions.
Syntax
neo4j-admin database load [-h] [--expand-commands] [--info] [--verbose] [--overwrite-destination[=true|false]]
[--additional-config=<file>] [--from-path=<path> | --from-stdin] <database>
Description
Load a database from an archive.
<archive-path> must be a directory containing an archive(s) created with the dump command.
If neither --from-path
or --from-stdin
is supplied server.directories.dumps.root
setting will be searched for the archive.
Existing databases can be replaced by specifying --overwrite-destination
.
It is not possible to replace a database that is mounted in a running Neo4j server.
If --info
is specified, then the database is not loaded, but information (i.e. file count, byte count, and format of load file) about the archive is printed instead.
Parameters
Parameter | Description | Default |
---|---|---|
|
Name of the database to load.
Can contain |
|
Options
Option | Description | Default |
---|---|---|
|
Configuration file with additional configuration. |
|
|
Allow command expansion in config value evaluation. |
|
|
Path to a directory containing archive(s) created with the dump command. |
|
|
Read dump from standard input. |
|
|
Show this help message and exit. |
|
|
Print meta-data information about the archive file, instead of loading the contained database. |
|
|
If an existing database should be replaced. |
|
Example
The following is an example of how to load the dump of the neo4j
database (neo4j.dump) created in the section Back up an offline database, using the neo4j-admin database load
command.
When replacing an existing database, you have to shut it down before running the command.
The --overwrite-destination
option is required because you are replacing an existing database.
If you are not replacing an existing database, you must create the database (using CREATE DATABASE
against the system
database) after the load operation finishes.
./neo4j-admin database load --from-path=/full-path/data/dumps <database> --overwrite-destination=true
The command looks for a file called <database>.dump where |
When using the |
|
Was this page helpful?