Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ The `'password'` can either be a string value or a string parameter with default
The `PLAINTEXT` and `ENCRYPTED` keywords are optional and can be used to specify the format of the password, i.e. whether Neo4j needs to hash it or it has already been hashed.
By default, all passwords are encrypted (hashed) when stored in the Neo4j `system` database.
* The optional `PLAINTEXT` in `SET PLAINTEXT PASSWORD` has the same behavior as `SET PASSWORD`.
* The optional `ENCRYPTED` is used to recreate an existing user when the plaintext password is unknown, but the encrypted password is available in the _data/databases/databasename/tools/metadata_script.cypher_ file of a database backup.
* The optional `ENCRYPTED` is used to recreate an existing user when the plaintext password is unknown, but the encrypted password is available in the _/data/scripts/databasename/restore_metadata.cypher_ file of restored database backup.
See xref:backup-restore/restore-backup#_restore_users_and_roles_metadata[Restore users and roles metadata]. +
With `ENCRYPTED`, the password string is expected to be in the format of `<encryption-version>,<hash>,<salt>`, where, for example:
** `0` is the first version and refers to the `SHA-256` cryptographic hash function with iterations `1`.
Expand Down Expand Up @@ -852,7 +852,7 @@ SET AUTH 'native' {SET PASSWORD 'abcd1234' SET PASSWORD CHANGE REQUIRED}

.Create user with an encrypted password
======
Or you can create the user `Jake` in an active state, with an encrypted password (taken from the _data/databases/databasename/tools/metadata_script.cypher_ of a database backup), and the requirement to not change the password by running:
Or you can create the user `Jake` in an active state, with an encrypted password (taken from the _/data/scripts/databasename/restore_metadata.cypher_ of a restored database backup), and the requirement to not change the password by running:

[source,cypher,role=noplay]
----
Expand Down Expand Up @@ -1008,7 +1008,7 @@ The `'password'` can either be a string value or a string parameter with default
The `PLAINTEXT` and `ENCRYPTED` keywords are optional and can be used to specify the format of the password, i.e. whether Neo4j needs to hash it or it has already been hashed.
By default, all passwords are encrypted (hashed) when stored in the Neo4j `system` database.
* The optional `PLAINTEXT` in `SET PLAINTEXT PASSWORD` has the same behavior as `SET PASSWORD`.
* The optional `ENCRYPTED` is used to recreate an existing user when the plaintext password is unknown, but the encrypted password is available in the _data/databases/databasename/tools/metadata_script.cypher_ file of a database backup.
* The optional `ENCRYPTED` is used to recreate an existing user when the plaintext password is unknown, but the encrypted password is available in the _/data/scripts/databasename/restore_metadata.cypher_ file when you restore a database backup.
See xref:backup-restore/restore-backup#_restore_users_and_roles_metadata[Restore users and roles metadata]. +
With `ENCRYPTED`, the password string is expected to be in the format of `<encryption-version>,<hash>,<salt>`, where, for example:
** `0` is the first version and refers to the `SHA-256` cryptographic hash function with iterations `1`.
Expand Down
6 changes: 3 additions & 3 deletions modules/ROOT/pages/backup-restore/restore-backup.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,16 @@ For more information, see xref:clustering/databases.adoc#cluster-seed[Designated

If you have backed up a database with the option `--include-metadata`, you can manually restore the users and roles metadata.

From the _<NEO4J_HOME>_ directory, you run the Cypher script _data/databases/databasename/tools/metadata_script.cypher_, which the `neo4j-admin database restore` command outputs, using xref:cypher-shell.adoc[]:
From the _<NEO4J_HOME>_ directory, you run the Cypher script _/data/scripts/databasename/restore_metadata.cypher_, which the `neo4j-admin database restore` command outputs, using xref:cypher-shell.adoc[]:

*Using `cat` (UNIX)*
[source, shell, role=nocopy noplay]
----
cat data/databases/databasename/tools/metadata_script.cypher | bin/cypher-shell -u user -p password -a ip_address:port -d system --param "database => 'databasename'"
cat ../data/scripts/databasename/restore_metadata.cypher | bin/cypher-shell -u user -p password -a ip_address:port -d system --param "database => 'databasename'"
----

*Using `type` (Windows)*
[source, shell, role=nocopy noplay]
----
type data\databases\databasename\tools\metadata_script.cypher | bin\cypher-shell.bat -u user -p password -a ip_address:port -d system --param "database => 'databasename'"
type ../data\scripts\databasename\restore_metadata.cypher | bin\cypher-shell.bat -u user -p password -a ip_address:port -d system --param "database => 'databasename'"
----
6 changes: 4 additions & 2 deletions modules/ROOT/pages/database-internals/store-formats.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,16 @@ For example:
----
@system> ALTER DATABASE mydb SET ACCESS READ ONLY;
----
. In your command-line tool, back up that database using the xref:backup-restore/online-backup.adoc[`neo4j-admin database backup`] command.
. In your command-line tool, back up that database using the xref:backup-restore/online-backup.adoc[`neo4j-admin database backup`] command with the `--include-metadata=all` option to include all users and roles associated with it.
For example:
+
[source,shell]
----
bin/neo4j-admin database backup mydb --to-path=/path/to/your-backup-folder --include-metadata=all
----
. Back in Cypher Shell, drop the database to delete it and all users and roles associated with it:
+
The command creates a backup archive that contains both the database and the metadata associated with it.
. In Cypher Shell, drop the database to delete it and all users and roles associated with it:
+
[source,cypher]
----
Expand Down