diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index ad06bab48..7130d3a9b 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -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. @@ -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 <> 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 @@ -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 @@ -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 diff --git a/modules/ROOT/pages/procedures.adoc b/modules/ROOT/pages/procedures.adoc index 50c103e51..60ae629de 100644 --- a/modules/ROOT/pages/procedures.adoc +++ b/modules/ROOT/pages/procedures.adoc @@ -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. ====