Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
39 changes: 38 additions & 1 deletion modules/ROOT/pages/clustering/databases.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ The recreate procedure allows you to:
* Make your database write-available again after it has been lost (for example, due to a disaster).
See xref:clustering/disaster-recovery.adoc[Disaster recovery] for more information.

* label:new[Introduced in 2025.02] Delete the data and schema for a database, while keeping the database privileges assigned to each role.

* label:new[Introduced in 2025.04] Alter the database store format when clearing the data and schema.

[CAUTION]
====
The recreate procedure works only for real user databases and not for composite databases, or the `system` database.
Expand All @@ -279,7 +283,8 @@ You need xref:authentication-authorization/dbms-administration.adoc#access-contr
To check if the recreation is successful, use the `SHOW DATABASES` command and verify that all allocations have been started.

Additionally, you have the option to modify <<alter-topology-recreate, the topology>> during the recreation process.
However, note that the store format, access, and enrichment cannot be altered during recreation.
However, note that up to Neo4j 2025.04, the store format, access, and enrichment cannot be altered during recreation.
Starting with 2025.04, the store format can only be altered if the `clearData` option is used.

[[recreate-seeding-options]]
=== Seeding options
Expand Down Expand Up @@ -356,6 +361,7 @@ This means the store is replaced by the most up-to-date seeder if available; oth
CALL dbms.recreateDatabase("neo4j", {seedingServers: [], seedURI: "s3://myBucket/myBackup.backup"});
----


[[alter-topology-recreate]]
=== Change the topology

Expand All @@ -370,6 +376,37 @@ If there are more available servers in the cluster hosting the database than the
CALL dbms.recreateDatabase("neo4j", {seedingServers: [], primaries: 3, secondaries: 0});
----


[role=label--new-2025.02]
[[clear-data-recreate]]
=== Clear data option

In Neo4j 2025.02, the `clearData` option was added to the recreate procedure.
This option allows you to delete the data (e.g., nodes and relationships) and the schema (e.g., constraints and indexes) for the database.
This means you end up with an empty store, but as with the other recreate database options, all privileges associated with the database are kept.

[CAUTION]
====
Using the clear data option means the data and schema will be deleted *permanently*.
If you want to have the option of getting them back later, make sure to take a backup before clearing the database.
See xref:backup-restore/online-backup.adoc[Online backup] for more information.
====

[role=label--new-2025.04]
[[alter-store-format]]
==== Alter the database store format

In Neo4j 2025.04, the database store format can also be altered during recreation, but only when the `clearData` option is specified.

See xref:database-internals/store-formats.adoc[Store formats], for more details about available database store formats in Neo4j.
If the store format option is not defined, the recreated database ends up with the same store format as before the recreation.

[source, shell]
----
CALL dbms.recreateDatabase("neo4j", {clearData: true, storeFormat: "block"});
----


[[cluster-seed]]
== Seed a cluster

Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/procedures.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ The procedure initiates a process, which when complete, will have synchronized a

[NOTE]
====
It is mandatory to specify either `seedURI` or `seedingServers` as seeding options in the `options` field.
It is mandatory to specify either `seedURI`, `seedingServers`, or `clearData` in the `options` field to define what store(s) the recreation should be based on.
Further details on how to use the `dbms.recreateDatabase()` procedure are provided in the related section inside the xref:clustering/databases.adoc#recreate-databases[Managing databases in a cluster] page.
If no topology option is defined, the database will be recreated with the previous topology.
====
Expand Down