Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate dbms.cluster.recreateDatabase #2210

Merged
merged 4 commits into from
Apr 7, 2025
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
7 changes: 7 additions & 0 deletions modules/ROOT/pages/changes-deprecations-removals.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,13 @@ For deprecations in Cypher language, see link:https://neo4j.com/docs/cypher-manu
| Enterprise Edition
| Comment

| xref:procedures.adoc#procedure_dbms_cluster_recreateDatabase[`dbms.cluster.recreateDatabase()`]
|
| {check-mark}
| label:deprecated[Deprecated in 2025.04] +
Replaced by xref:procedures.adoc#procedure_dbms_recreateDatabase[`dbms.recreateDatabase()`]


| xref:procedures.adoc#procedure_dbms_quarantineDatabase[`dbms.quarantineDatabase()`] label:admin-only[]
|
| {check-mark}
Expand Down
14 changes: 8 additions & 6 deletions modules/ROOT/pages/clustering/databases.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ neo4j@neo4j> DRYRUN REALLOCATE DATABASES;
[[recreate-databases]]
== Recreate a database

The xref:procedures.adoc#procedure_dbms_cluster_recreateDatabase[`dbms.cluster.recreateDatabase()`] procedure allows you to:
In Neo4j 2025.04, the xref:procedures.adoc#procedure_dbms_cluster_recreateDatabase[`dbms.cluster.recreateDatabase()`] procedure is deprecated in favour of xref:procedures.adoc#procedure_dbms_recreateDatabase[`dbms.recreateDatabase()`].

The recreate procedure allows you to:

* Change the database store to a specified backup, while keeping all the associated privileges for the database.

Expand Down Expand Up @@ -304,7 +306,7 @@ See xref::database-administration/standard-databases/seed-from-uri.adoc[Seed fro

[source, shell]
----
CALL dbms.cluster.recreateDatabase("neo4j", {seedURI: "s3://myBucket/myBackup.backup"});
CALL dbms.recreateDatabase("neo4j", {seedURI: "s3://myBucket/myBackup.backup"});
----

[[seed-servers]]
Expand All @@ -328,7 +330,7 @@ The number of defined servers cannot exceed the number of total allocations in t
+
[source, shell]
----
CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: ["serverId1", "serverId2", "serverId3"]});
CALL dbms.recreateDatabase("neo4j", {seedingServers: ["serverId1", "serverId2", "serverId3"]});
----

[[undefined-servers]]
Expand All @@ -339,7 +341,7 @@ The store will be replaced by the most up-to-date seeder available in the cluste
+
[source, shell]
----
CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: []});
CALL dbms.recreateDatabase("neo4j", {seedingServers: []});
----

[[undefined-servers-backup]]
Expand All @@ -351,7 +353,7 @@ This means the store is replaced by the most up-to-date seeder if available; oth
+
[source, shell]
----
CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: [], seedURI: "s3://myBucket/myBackup.backup"});
CALL dbms.recreateDatabase("neo4j", {seedingServers: [], seedURI: "s3://myBucket/myBackup.backup"});
----

[[alter-topology-recreate]]
Expand All @@ -365,7 +367,7 @@ If there are more available servers in the cluster hosting the database than the

[source, shell]
----
CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: [], primaries: 3, secondaries: 0});
CALL dbms.recreateDatabase("neo4j", {seedingServers: [], primaries: 3, secondaries: 0});
----

[[cluster-seed]]
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/import.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ Incremental import into an existing database.
The importer works well on standalone servers.

In clustering environments with multiple copies of the database, the updated database must be used as a source to reseed the rest of the database copies.
You can use the procedure xref:procedures.adoc#procedure_dbms_cluster_recreateDatabase[`dbms.cluster.recreateDatabase()`].
You can use the procedure xref:procedures.adoc#procedure_dbms_recreateDatabase[`dbms.recreateDatabase()`].
For details, see xref:clustering/databases.adoc#recreate-databases[Recreate databases].

Starting the clustered database after an incremental import without reseeding or performing the incremental import on a single server while the database remains online on other clustered members may result in unpredictable consequences, including data inconsistency between cluster members.
Expand Down
27 changes: 26 additions & 1 deletion modules/ROOT/pages/procedures.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ CALL dbms.cluster.readReplicaToggle("neo4j", false)
|===


[role=label--enterprise-edition]
[role=label--deprecated-2025.04 label--enterprise-edition]
[[procedure_dbms_cluster_recreateDatabase]]
=== dbms.cluster.recreateDatabase()

Expand Down Expand Up @@ -698,6 +698,31 @@ Running the procedure with an admin privilege is deprecated.
Running the procedure with an admin privilege is deprecated.
====


[role=label--enterprise-edition label--new-2025.04]
[[procedure_dbms_recreateDatabase]]
=== dbms.recreateDatabase()


.Details
|===
| *Syntax* 3+m| dbms.recreateDatabase(database :: STRING, options = {} :: MAP)
| *Description* 3+a| Recreates a database while keeping all RBAC settings.
The procedure initiates a process, which when complete, will have synchronized and started all database instances within the cluster.
.3+| *Input arguments* | *Name* | *Type* | *Description*
| `database` | `STRING` | The name of the database to recreate.
| `options` | `MAP` | The seeding and topology options to use for recreating the database.
| *Mode* 3+| WRITE
|===

[NOTE]
====
It is mandatory to specify either `seedURI` or `seedingServers` as seeding options in the `options` field.
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.
====


[role=label--admin-only label--enterprise-edition]
[[procedure_dbms_setDefaultAllocationNumbers]]
=== dbms.setDefaultAllocationNumbers()
Expand Down