10.1. Neo4j Admin

This section describes the Neo4j Admin tool.

Neo4j Admin is the primary tool for managing your Neo4j instance. It is a command-line tool that is installed as part of the product and can be executed with a number of commands. Some of the commands are described in more detail in separate sections.

10.1.1. Syntax and commands

Neo4j Admin is located in the bin directory and is invoked as:

neo4j-admin <command>

Functionality area Command Description

General

help

help <command>

Display help text.

Display help text for <command>

check-consistency

Check the consistency of a database.

For details, see Section 10.2, “Consistency checker”.

report

Collect the most common information needed for remote assessments.

For details, see Report tool.

store-info

Print information about a Neo4j database store.

For details, see Section 10.4, “Display store information”.

memrec

Print Neo4j heap and pagecache memory settings recommendations.

For details, see Memory recommendations.

import

Import from a collection of CSV files or a pre-3.0 database.

For details, see Section 10.6, “Import”.

Authentication

set-default-admin

Sets the default admin user when no roles are present.

set-initial-password

Sets the initial password of the initial admin user (neo4j).

Offline backup

For details see Section 10.7, “Dump and load databases”.

dump

Dump a database into a single-file archive.

load

Load a database from an archive created with the dump command.

Online backup

For details see Chapter 6, Backup.

backup

Perform an online backup from a running Neo4j server.

restore

Restore a backed-up database.

Clustering

unbind

Removes cluster state data for the specified database.

For details, see Section 10.8, “Unbind a database”.

10.1.2. Environment variables

Neo4j Admin can utilize the following environment variables:

NEO4J_DEBUG

Set to anything to enable debug output.

NEO4J_HOME

Neo4j home directory.

NEO4J_CONF

Path to directory which contains neo4j.conf.

HEAP_SIZE

Set JVM maximum heap size during command execution. Takes a number and a unit, for example 512m.

10.1.3. Exit codes

If neo4j-admin finishes as expected it will return an exit code of 0. A non-zero exit code means something undesired happened during command execution. The non-zero exit code can contain further information about the error, such as the backup command’s exit codes.