Offline bulk loading data with neo4j-admin database import
neo4j-admin database import is an offline, high-throughput utility tool for bulk-loading data into Neo4j.
It supports two input formats (CSV and Parquet) and operates by writing database store files directly to disk, bypassing the transaction layer.
This is what makes it substantially faster at scale than other import methods, but it also means there is no rollback capability if the import fails partway through, no constraint checking during the load, and the target database must be fully offline for the entire duration.
It is the appropriate tool when the goal is initial population of a new database from a large dataset (typically hundreds of millions of entities or more) and when a period of downtime for the target instance is acceptable. It is not suitable for updating an existing database or any environment where the database cannot be taken fully offline for the duration of the load.
To load a database created by neo4j-admin database import into an Aura instance, run the import locally first, then use neo4j-admin database upload to push the resulting database to Aura.
Alternatively, the Bulk import for Aura can be used (currently in Preview, and only available to Virtual Dedicated Cloud, Business Critical, and Professional instances).
For the complete documentation on neo4j-admin database import, see the Operations Manual → Import.
Pre-import
neo4j-admin database import is designed for full bulk loads.
It creates a new database from source files and cannot be used to update to an existing one.
The target database must be offline and non-existent at the time of the import (the database to which the source files are written are created after the import has completed; see Create the database below).
If the target is a standalone instance, run the import directly against it.
For clustered environments, see Loading into a clustered environment below.
| The neo4j-admin binary must be the same version as the Neo4j DBMS that will run the resulting database, or the import may not start correctly. |
CSV/Parquet file formatting
neo4j-admin database import writes directly to store files.
As such, data must be correctly typed and structured in the source files before the run.
Note the following:
-
Each node must provide a unique ID, via an explicit
:IDcolumn, scoped by an ID space name where raw IDs could otherwise collide across files (e.g.productId:ID(Product)). The ID’s type (string(default) orinteger) is set once for the whole import with the--id-typeflag, not declared per column. -
For non-ID fields, the header declares the type, and the importer casts to it at load time (e.g.,
unitPrice:float). A mismatch between the header’s declared type and the actual value is a hard failure, not something--bad-tolerancecan skip. -
Labels/relationship types are set via a
:LABEL/:TYPEcolumn in the file, or via the--nodes=Label=fileflag prefix in the import (though not both). -
A header applies to the group of files passed to a single
--nodes=/--relationships=flag. All files in that group must share the same columns, since the importer reads them as one continuous input rather than validating each file independently. -
Parquet takes types from its own embedded schema, not a header row, but ID/ID-space designation still needs to be specified separately, since Parquet has no native concept of node identity.
productId:ID(Product),productName,unitPrice:float,unitsInStock:int,:LABEL
1,Chai,18.0,39,Product
2,Chang,19.0,17,Product
3,Aniseed Syrup,10.0,13,Product
-
productId:ID(Product): the ID field, scoped to theProductID space so relationship files can reference it. -
productName: no explicit type given, will therefore default toSTRING. -
unitPrice:float, unitsInStock:int, discontinued:int: typed properties, cast on read. -
:LABEL: sets the node label (Productin this case) per row.
categoryId:ID(Category),categoryName,description,:LABEL
1,Beverages,”Soft drinks, coffees, teas, beers, and ales”,Category
2,Condiments,”Sweet and savory sauces, relishes, spreads”, and seasonings, Category
3,”Confections,desserts, candies, and sweet breads”,Category
:START_ID(Product),:END_ID(Category),:TYPE,since:date
1,1,PART_OF,2020-01-15
2,1,PART_OF,2019-06-01
3,2,PART_OF,2021-03-30
-
:START_ID(Product): references theProductID space fromimport-product-nodes.csv. -
:END_ID(Category): referencesCategoryID space defined inimport-category-nodes.csv. -
:TYPE: sets the relationship type per row (PART_OF, in this example). -
since:date: a typed property on the relationship itself, following the same<name>:<type>header convention as node properties.
Node files establish ID spaces; relationship files reference those same spaces to link rows together, without any MATCH.
1 in :START_ID(Product) resolves to the node where productId:ID(Product) was 1, and the same goes for :END_ID(Category).
In other words, importing these files would create the following pattern: (:Product {productName :: STRING, unitPrice:FLOAT,unitsInStock:INTEGER})-[:PART_OF {since :: DATE}]→(Category {categoryName :: STRING, description :: STRING}).
Establish size of import
Start with total file size across all input files. The files could either exist in a local directory or accessed through cloud storage.
The size of the import is the baseline for memory and disk planning. Do not use the size of the source system as a proxy; the CSV files exported from it can be significantly larger or smaller depending on how many columns are exported, whether multi-value fields are expanded into separate rows, and what types string values are cast into. Get the actual sizes from the export files themselves.
$NEO4J_HOME/import/
du -sh $NEO4J_HOME/import/
wc -l $NEO4J_HOME/import/*.csv
Remember to subtract one row per file to account for the header.
Record the following before continuing:
-
Total file size across all input files: this is the primary input for memory and disk sizing in the next sections.
-
Node count per label: needed to validate the import completed fully; can be used to compare against the database counts post-import.
-
Relationship count per type: same reason as for nodes; a silent failure can import nodes successfully but drop relationships entirely.
-
Largest single file: the import processes files individually, so the largest single file sets the memory floor for the run.
Confirm file ownership
If a different user account ran the import than the one the Neo4j server runs as, make sure the Neo4j server’s user can read the files written to the database directory before starting it. Otherwise the database fails to start with a permissions error.
This shows up most often in the containerized and cloud volume mount cases, where the import and the running server aren’t guaranteed to run as the same user. Before starting the database, confirm the store directory is owned by (or readable by) the user the Neo4j server runs as:
chown -R neo4j:neo4j $NEO4J_HOME/data/databases/<database-name>
Dry-run the import
Before performing the actual import, run a dry-run to validate the input files and estimate the size of the import. The command checks the input files and reports estimated entity counts, sizes, and available memory without writing any data to the database.
bin/neo4j-admin database import full \
--dry-run=true \
--nodes=$NEO4J_HOME/import/nodes.csv \
--relationships=$NEO4J_HOME/import/relationships.csv \
<database-name>
The output reports:
-
Available resources
-
Total machine memory
-
Free machine memory
-
Max heap memory
-
Max worker threads
-
Configured max memory
-
High parallel IO
-
-
Estimates entity (nodes, relationships, and properties) counts/sizes
Hardware recommendations
For Neo4j’s general hardware recommendations, see the Operations Manual → Disks, RAM, and other tips.
Memory configuration
neo4j-admin database import uses two memory controls:
-
Heap: JVM memory for Java objects created during the import process. Configured via the
HEAP_SIZEenvironment variable:export HEAP_SIZE=2g -
Off-heap: working memory used by the import’s internal caches and data structures. This is where the import does its actual work. Configured via the
--max-off-heap-memoryflag:bin/neo4j-admin database import full \ --max-off-heap-memory=<size> \ --nodes=$NEO4J_HOME/import/nodes.csv \ --relationships=$NEO4J_HOME/import/relationships.csv \ <database-name>
Both pools draw from the same physical memory. Allocating too much to heap leaves less for off-heap caches, which will degrade import performance. It is recommended to keep heap small and give as much as possible to off-heap. If the heap is set too high, the tool will warn you and suggest a lower value.
- Sizing heap
-
Keep heap small: 2-4 GB is sufficient for most imports regardless of dataset size. Heap is only used for JVM object overhead during the run, not the actual working set, so allocating more than this does not improve throughput and leaves less memory available for off-heap.
- Sizing off-heap
-
If
--max-off-heap-memoryis not set, the importer defaults to using 90% of the available free memory on the machine. It is, however, recommended to explicitly set an off-heap value. Then verify that the "Configured max memory" figure in the dry-run output reflects what you expect before committing to the full run.
CPU
The import parallelizes across all available cores by default.
Cap this explicitly with --threads=<num> if running on shared or resource-constrained hardware.
More cores generally reduce import time, since more of the work can run in parallel, though disk I/O is often the actual bottleneck at scale, not CPU, so core count alone is not a reliable predictor of import speed.
Disk sizing and relocating temporary storage
Before running neo4j-admin database import, make sure enough disk is provisioned to hold, simultaneously:
-
Input files: the source CSVs/Parquet (if they are hosted locally rather than streamed from cloud storage).
-
Twice the estimated final database size: the import needs room for both the store files being built and temporary space requirements during the build.
-
Log files: progress/report logs.
If a backup will run immediately after import, budget closer to three times final database size, since the backup artifact sits alongside the live store while it is being written.
As a general practice, provision disk with headroom above these minimums rather than sizing exactly to them. Running out of space mid-import or mid-backup is more costly to recover from than the cost of the extra allocation.
IOPS matters more than raw throughput when importing, since the import performs many small write operations rather than one long sequential write. SSD storage handles this pattern far better than spinning disk, which is mechanically limited in how many operations it can service per second regardless of its capacity. When choosing cloud storage specifically, check the provisioned IOPS of the tier being used, not just its capacity or advertised throughput figure. AWS’s general purpose SSD tier (gp3), for example, defaults to a baseline of 3000 IOPS regardless of volume size, and needs to be explicitly provisioned higher for large-scale imports.
Temporary space requirements scale with dataset size.
Use --temp-path to point temporary files at the fastest disk available, particularly if the disk hosting the database directory does not have sufficient space:
bin/neo4j-admin database import full \
--temp-path=/path/to/temp \
--nodes=$NEO4J_HOME/import/nodes.csv \
--relationships=$NEO4J_HOME/import/relationships.csv \
<database-name>
This is particularly relevant in any environment where the disk is explicitly partitioned or capped (containerized deployments such as Kubernetes, self-managed cloud instances with attached storage volumes (AWS, GCP, Azure), or on-prem setups where the database directory sits on a dedicated mount). In these environments, the volume is typically sized for the final database and does not account for the additional overhead of the import process.
Defining a schema for the importEnterprise Edition
neo4j-admin database import cannot run against a database that already has constraints or indexes; the target must be non-existent, and schema elements only get created as part of the import run itself, via --schema (block format only).
Using --schema requires writing a schema file before running the import.
This is a plain text file containing Cypher® statements creating constraints (either separately or, preferably, through a graph type) and/or indexes saved to a disk at a path of your choosing.
| Index-backed key constraints are vital both to the performance and quality of data ingestion. For more information, see Best practices → Index-backed key constraints and type constraints. |
ALTER CURRENT GRAPH TYPE SET {
(c:Customer => { id :: INTEGER NOT NULL }) REQUIRE c.id IS KEY,
(p:Product => { id :: INTEGER NOT NULL }) REQUIRE p.id IS KEY
}
Building indexes during the import takes longer than a schema-free import alone, but it avoids a separate indexing pass afterward. The combined time is still faster than doing the two separately, since the importer can use all available threads for index population and writes index data directly from the input instead of reading it back from the store afterward.
Define the schema before starting the load, and only include indexes and constraints the load itself depends on. Indexes only needed for later application queries are better added afterward, once the database is running.
bin/neo4j-admin database import full \
--nodes=Person=$NEO4J_HOME/import/persons.csv \
--relationships=$NEO4J_HOME/import/relationships.csv \
--schema=$NEO4J_HOME/import/schema.cypher \
<database-name>
Once the import has been completed and you have switched to the designated database, confirm the existence of the schema with SHOW CONSTRAINTS, SHOW CURRENT GRAPH TYPE, or SHOW INDEXES depending on the content of the schema file.
Running the import
It is recommended to start conservative on a smaller but fully representative subset of the real data (around 100,000 rows/nodes covering every node and relationship type). Note the steady-state time-per-percent from the progress output during that run.
During the full run, compare later segments against that baseline: if the time-per-percent grows rather than holding steady, treat it as a sign of resource contention (off-heap memory, disk I/O) and investigate rather than letting it run to completion.
Common initial errors
The most common errors found when importing a sample of the data is related to incorrectly formatted CSV files. See CSV/Parquet formatting above for information on how to correctly format data.
See also What to do after a failed import below for information on how to handle errors logged in the report.json.log file.
Header mismatches
A header can be supplied as a separate file instead of as the first line of the data file (useful when the data file should not be edited directly, or when the same header applies to multiple data files). This breaks if the data file paired with that separate header also contains its own header row.
categoryId:ID(Category),categoryName
categoryId,categoryName
1,Beverages
2,Condiments
The importer does not know to skip that first line in the data file, so it tries to create a node from categoryId,categoryName itself (i.e., (:Category {categoryId: "categoryId", categoryName: "categoryName"})).
Best case, it fails because those values cannot be cast to whatever type the real header declared.
Worst case, it succeeds and a garbage node ends up in the database.
Before pairing a data file with a separate header file, check the data file does not already have its own header row.
If it does, remove it.
ID space errors
productId:ID(Product),productName
1,Chai
:START_ID(Item),:END_ID(Category),:TYPE
1,1,PART_OF
The part-of-relationships file references Item as the start ID space, but the products file defines its ID space as Product.
Because the names do not match, the importer cannot resolve the relationship to the existing product node.
Make sure that the ID space name referenced in :START_ID(…)/:END_ID(…) matches exactly the ID space name declared in the corresponding node file’s :ID(…) column.
Malformed quoting
categoryId:ID(Category),categoryName
1,Chef's Kitchen
With the default double-quote (") as the quote character, this works fine; the apostrophe is not the quote character, so it is treated just as a normal part of the text.
The problem shows up if the --quote option is set to a single quote (').
In that case, the apostrophe inside Chef’s gets read as a quote character rather than as part of the word, splitting the field incorrectly, without throwing an error, since the syntax still looks valid to the parser.
Fix malformed quoting in the small sample size by including a value such as Chef’s Kitchen in the sample, then query the resulting node afterward to confirm the property matches the source exactly.
Set error handling deliberately
For large datasets, logging and skipping bad rows is often more practical than aborting on the first error. A separate pass can handle failed records afterward, rather than losing an entire run to a small number of bad rows. Explicit configuration for this behavior:
-
--bad-tolerance=<num>: the number of bad entries allowed before the import aborts. The default value is-1(unlimited tolerance as of the Neo4j 2025.12 release; behavior in earlier releases may differ). -
--skip-bad-relationships=true: skips relationships that reference missing node identifiers, rather than failing the import. -
--skip-duplicate-nodes=true: skips nodes with duplicate identifiers, rather than failing the import.
The <num> value for --bad-tolerance should be based on the expected amount of bad data.
Skipped entries are written to a report file (report.json.log by default), not shown in the terminal during the run, so leaving them logged (the default behavior, rather than disabling logging with --skip-bad-entries-logging=true) allows them to be identified and reprocessed afterward
Use --report-file=<path> to redirect the report’s location if needed.
bad-tolerance only covers missing node references and duplicate node identifiers.
A type mismatch (e.g., a STRING value where a numeric type is expected, or an incorrect number of dimensions in a vector property) is never tolerated and always aborts the import, regardless of the --bad-tolerance setting.
Datasets with type issues need cleaning before the run; skipping does not resolve that category of problem.
|
Protect against session termination
For a full run that may take hours, run it detached from the shell so that an SSH disconnect does not kill it mid-import:
nohup bin/neo4j-admin database import full \
--nodes=$NEO4J_HOME/import/nodes.csv \
--relationships=$NEO4J_HOME/import/relationships.csv \
<database-name> > import.log 2>&1 &
nohup prevents the process from receiving a hangup signal when the terminal session ends.
The trailing & runs the command in the background, returning control of the shell immediately.
Redirecting output to a log file (> import.log 2>&1) captures progress and errors that would otherwise print to a terminal that may no longer be attached by the time the import finishes.
Monitor progress and problems during import
Since Neo4j 2026.04, the import writes structured progress snapshots to progress.json.log, inside a per-run directory at $NEO4J_HOME/logs/<database-name>-<timestamp>/.
Each line is a separate, complete JSON object representing one snapshot in time, so the file can be read incrementally as new lines are appended:
{"nodeStats":{"processed":91,"created":91},"relationshipStats":{"processed":830,"created":830},"nodePerLabelStats":{"Product":{"processed":77,"created":77},"Category":{"processed":8,"created":8}},"relationshipPerTypeStats":{"PART_OF":{"processed":77,"created":77}}}
If running a version earlier than Neo4j 2026.04 in the background, or if the import is in the foreground with output printing directly to the terminal, monitor progress instead by tailing the redirected log file: tail -f import.log.
|
The same per-run directory also contains report.json.log, recording any skipped or invalid records, one JSON entry per line (see the next section for an example).
If progress stalls at a fixed percentage with no error, treat it as a known failure pattern: kill the process rather than waiting indefinitely, and investigate before retrying. A stall like this can also be the visible symptom of the process slowly running out of memory rather than being stuck. Check for this before assuming otherwise:
-
System-level kill:
dmesg | grep -i "out of memory"(or check/var/log/syslog). A hit here means the operating system killed the process. -
Process-level exit: check the import’s own log for an
OutOfMemoryErrormessage. Neo4j is configured to exit the JVM on this condition rather than continue running indefinitely.
What to do after a failed import
Review report.json.log inside to identify exactly which records failed and why.
Each entry identifies a specific problem, the affected record, and enough detail to trace it back to a line in the source file.
Since neo4j-admin database import cannot run against an existing database, fixing and reprocessing failed records still means correcting them in the source files and rerunning the import, but knowing precisely which records to fix, rather than treating the whole dataset as suspect, makes that rerun far faster to prepare.
{"problem":"BadRelationship","message":"Invalid relationship in import data\n(4)-[PART_OF]->(99:Category) referring to missing node null","source":null,"line":0,"relationship":{"type":"PART_OF","source":{"id":"4","group":null},"target":{"id":"99","group":"Category"},"missing":true}}
-
"problem":"BadRelationship": the category of issue. This one means a relationship in the source file points to a node that does not exist. -
"message": a human readable description. In this case, aPART_OFrelationship tried to connect product ID4to category ID99, but the source node could not be found. -
"relationship":{"type":"PART_OF", …}: the specific relationship type involved. -
"source":{"id":"4", …}: the ID of the source node. -
*
"target": {"id":"99","group":"Category"}: the ID of the target node. -
"missing":true: confirms this is a missing reference case, not some other kind of malformed data.
How to fix it:
-
Check both the source and target IDs against the relevant CSV files.
-
Correct the source data: fix the ID if it was mistyped, or add the missing row if it should exist but was left out of the export.
-
Re-run the sample with the corrected files.
Record the run
Save the full command, every flag, and the environment used (Neo4j version, machine specs, HEAP_SIZE, --max-off-heap-memory) for each import run.
If a failure needs to be escalated, this allows for reproduction of the exact conditions rather than guessing at what changed.
Verification
Once the import has completed, compare post-import node and relationship counts against the counts you recorded from the source files before the run (see Establish size of import above).
Do not rely on the import’s live progress display as a proxy for this: for neo4j-admin database import it reports rows processed, not entities created.
Create the database
neo4j-admin database import only writes store files, it does not create the database with the DBMS.
After the import completes, it is therefore necessary to create the database:
CREATE DATABASE <database-name> WAIT
<database-name> must match exactly that given in the import, and no other database with that name can exist prior to its creation.
|
SHOW DATABASES
:use <database-name>
Example
neo4j-admin-database-importFor this example, the Northwind dataset will be used (hosted at https://github.com/neo4j-graph-examples/northwind), pre-formatted as CSV files with labeled node and relationship types.
du -sh import/
wc -l import/*.csv
164K import/
9 import/import_categories.csv
92 import/import_customers.csv
10 import/import_employees.csv
831 import/import_orders.csv
78 import/import_products.csv
831 import/import_rel_customer_order.csv
831 import/import_rel_employee_order.csv
2156 import/import_rel_order_product.csv
78 import/import_rel_product_category.csv
78 import/import_rel_product_supplier.csv
30 import/import_suppliers.csv
5024 total
Remember to exclude 1 row for the header row in each file when counting data rows.
bin/neo4j-admin database import full northwind \
--nodes=Product=import/import_products.csv \
--nodes=Category=import/import_categories.csv \
--nodes=Supplier=import/import_suppliers.csv \
--nodes=Customer=import/import_customers.csv \
--nodes=Employee=import/import_employees.csv \
--nodes=Order=import/import_orders.csv \
--relationships=PART_OF=import/import_rel_product_category.csv \
--relationships=SUPPLIED_BY=import/import_rel_product_supplier.csv \
--relationships=PURCHASED=import/import_rel_customer_order.csv \
--relationships=SOLD=import/import_rel_employee_order.csv \
--relationships=CONTAINS=import/import_rel_order_product.csv \
--dry-run
Available resources:
Total machine memory: 64.00GiB
Free machine memory: 6.920GiB
Max heap memory : 14.22GiB
Max worker threads: 10
Configured max memory: 3.152GiB
High parallel IO: true
Estimated entity counts / sizes:
Nodes: 1051
Labels: 1051
Total property count: 3451
Total properties size: 46.23KiB
Relationships: 3980
Total property count: 6473
Total properties size: 54.79KiB
Estimated server sizing:
Disk: 1.000GiB
This is a small dataset, so the defaults reported in the dry-run (14.22GiB heap, 3.152GiB off-heap) are far beyond what is needed.
However, heap/off-heap could be modified to something like HEAP_SIZE=2g and --max-off-heap-memory=512m, and it would still import this dataset just as fast.
ALTER CURRENT GRAPH TYPE SET {
(p:Product => {productId :: INTEGER, productName :: STRING}) REQUIRE p.productId IS KEY,
(c:Category => {categoryId :: INTEGER, categoryName :: STRING}) REQUIRE c.categoryId IS KEY,
(s:Supplier => {supplierId :: INTEGER, companyName :: STRING}) REQUIRE s.supplierId IS KEY,
(cu:Customer => {customerId :: INTEGER, companyName :: STRING}) REQUIRE cu.customerId IS KEY,
(e:Employee => {employeeId :: INTEGER, lastName :: STRING}) REQUIRE e.employeeId IS KEY,
(o:Order => {orderId :: INTEGER, orderDate :: DATE}) REQUIRE o.orderId IS KEY
}
As this dataset is small, it is not necessary to start with a sample or to project against session termination, and since the dry-run came back clean, it is also not necessary to set error handling.
bin/neo4j-admin database import full northwind \
--nodes=Product=import/import_products.csv \
--nodes=Category=import/import_categories.csv \
--nodes=Supplier=import/import_suppliers.csv \
--nodes=Customer=import/import_customers.csv \
--nodes=Employee=import/import_employees.csv \
--nodes=Order=import/import_orders.csv \
--relationships=PART_OF=import/import_rel_product_category.csv \
--relationships=SUPPLIED_BY=import/import_rel_product_supplier.csv \
--relationships=PURCHASED=import/import_rel_customer_order.csv \
--relationships=SOLD=import/import_rel_employee_order.csv \
--relationships=CONTAINS=import/import_rel_order_product.csv \
--schema=import/schema.cypher \
Once the import completes, create the database using the same name that was used in the import.
northwind databaseCREATE DATABASE northwind WAIT
SHOW DATABASES
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| name | type | aliases | access | address | role | writer | requestedStatus | currentStatus | statusMessage | default | home | constituents |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| "neo4j" | "standard" | [] | "read-write" | "localhost:7687" | "primary" | TRUE | "online" | "online" | "" | TRUE | TRUE | [] |
| "northwind" | "standard" | [] | "read-write" | "localhost:7687" | "primary" | TRUE | "online" | "online" | "" | FALSE | FALSE | [] |
| "system" | "system" | [] | "read-write" | "localhost:7687" | "primary" | TRUE | "online" | "online" | "" | FALSE | FALSE | [] |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
northwind database:use northwind
SHOW CURRENT GRAPH TYPE
+-----------------------------------------------------------------------------------------------+
| specification |
+-----------------------------------------------------------------------------------------------+
| "{ |
\ (:`Category` => {`categoryId` :: INTEGER, `categoryName` :: STRING}), |
\ (:`Customer` => {`companyName` :: STRING, `customerId` :: INTEGER}), |
\ (:`Employee` => {`employeeId` :: INTEGER, `lastName` :: STRING}), |
\ (:`Order` => {`orderDate` :: DATE, `orderId` :: INTEGER}), |
\ (:`Product` => {`productId` :: INTEGER, `productName` :: STRING}), |
\ (:`Supplier` => {`companyName` :: STRING, `supplierId` :: INTEGER}), |
\ CONSTRAINT `constraint_cb68693c` FOR (`n`:`Category` =>) REQUIRE (`n`.`categoryId`) IS KEY, |
\ CONSTRAINT `constraint_30627857` FOR (`n`:`Customer` =>) REQUIRE (`n`.`customerId`) IS KEY, |
\ CONSTRAINT `constraint_c876ed21` FOR (`n`:`Employee` =>) REQUIRE (`n`.`employeeId`) IS KEY, |
\ CONSTRAINT `constraint_103e799e` FOR (`n`:`Order` =>) REQUIRE (`n`.`orderId`) IS KEY, |
\ CONSTRAINT `constraint_84371cb7` FOR (`n`:`Product` =>) REQUIRE (`n`.`productId`) IS KEY, |
\ CONSTRAINT `constraint_5ea7e5dc` FOR (`n`:`Supplier` =>) REQUIRE (`n`.`supplierId`) IS KEY |
\ }" |
+-----------------------------------------------------------------------------------------------+
RETURN COUNT { (:Product)-[:PART_OF]->(:Category) } AS part_of,
COUNT { (:Product)-[:SUPPLIED_BY]->(:Supplier) } AS supplied_by,
COUNT { (:Customer)-[:PURCHASED]->(:Order) } AS purchased,
COUNT { (:Employee)-[:SOLD]->(:Order) } AS sold,
COUNT { (:Order)-[:CONTAINS]->(:Product) } AS contains
| part_of | supplied_by | purchased | sold | contains |
|---|---|---|---|---|
|
|
|
|
|
Rows: 1 |
||||
The number of relationships are as expected when compared to the initial row count.
Loading into a clustered environmentEnterprise Edition
neo4j-admin database import only ever writes store files to a single, offline instance; it cannot target a cluster member directly.
To get imported data into a cluster:
-
Set up the cluster (Enterprise Edition required): multiple servers configured to discover each other via
dbms.cluster.endpointsinneo4j.conf. See the Operations Manual → Deploy a basic cluster for full server configuration. -
Run the import against a standalone instance as described above, not against a cluster member.
-
Create the database and switch to it:
neo4j-admin database backupis an online backup command; it needs a running, started database to back up, not raw store files straight off the import: -
Back up the now-running database:
bin/neo4j-admin database backup --to-path=/path/to/backups northwind--to-pathis the destination directory;northwindis the database name being backed up. This writes a backup artifact to/path/to/backups/northwind-<timestamp>.backup. -
Seed the cluster from that backup:
CREATE DATABASE northwind TOPOLOGY 3 PRIMARIES OPTIONS { seedURI: 'file:/path/to/backups/northwind-<timestamp>.backup' }The
file:scheme requires an absolute path, and it is read by each cluster server locally; the backup file needs to be reachable from wherever your cluster nodes actually run. If instead pushing to S3/GCS/Azure, upload the backup artifact first and swap in the matchings3://,gs://, orazb://URI. For more information, see the Operations Manual → Backup a database to a cloud storage.