You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Explain how existing store files work, this has never really been well
documented
* Add a different set of options for Cypher 25
* WAIT is different in Cypher 25.
---------
Co-authored-by: Nick Giles <[email protected]>
Co-authored-by: akarasavov <[email protected]>
Co-authored-by: Reneta Popova <[email protected]>
Co-authored-by: Nick Giles <[email protected]>
Copy file name to clipboardExpand all lines: modules/ROOT/pages/database-administration/standard-databases/create-databases.adoc
+103-2Lines changed: 103 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,9 @@ For more information, see link:{neo4j-docs-base-uri}/upgrade-migration-guide/upg
19
19
== Create databases
20
20
21
21
You can create a database using the Cypher command `CREATE DATABASE`.
22
+
The initial contents of the database depend on the state of the server and the options provided to the command.
23
+
When no additional options are provided, `CREATE DATABASE` will attempt to mount any pre-existing store files in place (e.g., as the result of restoring a backup).
24
+
If no pre-existing store files are available, it will create an empty database.
22
25
23
26
[NOTE]
24
27
====
@@ -64,6 +67,11 @@ CREATE OR REPLACE DATABASE name
64
67
[[manage-databases-create-database-options]]
65
68
=== Options
66
69
70
+
[.tabbed-example]
71
+
=====
72
+
[.include-with-cypher-5]
73
+
======
74
+
67
75
The `CREATE DATABASE` command can have a map of options, e.g. `OPTIONS {key: 'value'}`.
68
76
69
77
[options="header"]
@@ -90,7 +98,7 @@ Replaced by `existingDataSeedServer`.
90
98
| `seedURI`
91
99
| URI to a backup or a dump from an existing database.
92
100
|
93
-
Defines an identical seed from an external source which will be used to seed all servers.
101
+
Defines a seed from an external source, which will be used to seed all servers.
94
102
95
103
| `seedConfig`
96
104
| Comma-separated list of configuration values.
@@ -128,7 +136,70 @@ Starting from Neo4j 2025.01, you can use `existingData`, `seedURI`, `seedConfig`
128
136
The `existingDataSeedInstance` and `existingDataSeedServer` are still not supported with the `CREATE OR REPLACE DATABASE` command.
129
137
More details about seeding options can be found in xref::clustering/databases.adoc#cluster-seed[Seed a cluster].
130
138
====
139
+
======
140
+
[.include-with-cypher-25]
141
+
======
142
+
The `CREATE DATABASE [OR REPLACE]` command can have a map of options, e.g., `OPTIONS {key: 'value'}`.
143
+
144
+
[options="header"]
145
+
|===
146
+
147
+
| Key | Value | Description
148
+
149
+
|`existingDataSeedServer`
150
+
| ID of the cluster server
151
+
|
152
+
Defines which server is used for seeding the data of the created database.
153
+
The server ID can be found in the `serverId` column after running `SHOW SERVERS`.
154
+
155
+
| `seedURI`
156
+
| URI to a backup, a folder that contains backup artifacts or a dump from an existing database.
157
+
|
158
+
Defines a seed from an external source, which will be used to seed all servers.
159
+
160
+
| `seedConfig`
161
+
| Comma-separated list of configuration values.
162
+
|
163
+
For more information see xref::clustering/databases.adoc#cluster-seed-uri[Seed from URI].
164
+
165
+
| `txLogEnrichment`
166
+
| `FULL` \| `DIFF` \| `OFF`
167
+
|
168
+
Defines the level of enrichment applied to transaction logs for Change Data Capture (CDC) purposes.
169
+
170
+
For details about enrichment mode, see link:{neo4j-docs-base-uri}/cdc/current/get-started/self-managed/#set-enrichment-mode/[Change Data Capture Manual -> Enable CDC on self-managed instances -> Set the enrichment mode].
Defines the store format if the database created is new.
176
+
`high_limit` and `standard` formats are deprecated from 5.23.
177
+
For more information on store formats, see xref::database-internals/store-formats.adoc[Store formats].
178
+
179
+
If the store is seeded with `seedURI` or `existingDataSeedServer`, or if the command is used to mount pre-existing store files already present on the disk, they will retain their current store format without any modifications.
180
+
181
+
| `seedRestoreUntil`
182
+
| Datetime or transaction id. E.g. `datetime("2025-01-01T12:15:00.000+0100")` or `123456`
183
+
|
184
+
If you are passing a `seedURI` that leads to a backup chain, including differential backups, you can choose to not apply all the transactions in the differential backups.
185
+
To seed up to a specific date, specify a `datetime`.
186
+
This will seed the database with transactions committed before the provided timestamp.
187
+
To seed up to a specific transaction ID, specify a transaction ID.
188
+
This will seed the database with transactions up to, but not including the specified transaction.
189
+
190
+
| `seedSourceDatabase`
191
+
| A source database name
192
+
|
193
+
If the `seedURI` points to a folder containing backups for multiple databases, you can specify the database name to filter the artifacts.
194
+
195
+
| `existingData` label:deprecated[Deprecated]
196
+
| `use`
197
+
|
198
+
Included for backward compatibility only, has no effect and will be removed in a future version.
199
+
200
+
|===
201
+
======
202
+
=====
132
203
133
204
=== Examples
134
205
@@ -164,7 +235,11 @@ SHOW DATABASES YIELD name
164
235
165
236
==== Create a database with xref:database-administration/standard-databases/wait-options.adoc[`WAIT`]
166
237
167
-
Sub-clause `WAIT` allows you to specify a time limit in which the command must complete and return.
238
+
[.tabbed-example]
239
+
=====
240
+
[.include-with-cypher-5]
241
+
======
242
+
Sub-clause `WAIT` allows you to specify a time limit for the command to complete and return.
The command returns a notification for each server in the cluster to indicate the status of that command on that server.
285
+
In this example, all three cluster members have returned `Neo.ClientNotification.Cluster.ServerCaughtUp`, which indicates that the server has applied the command successfully and is up to date.
286
+
======
287
+
=====
187
288
188
289
==== Create databases with `IF NOT EXISTS` or `OR REPLACE`
0 commit comments