Skip to content

Commit c144cf6

Browse files
Fix Cypher examples to show its both versions (#2362)
When Cypher 25 is released, we'll continue to show query examples for Cypher 5. When PR #2368 is merged, this one needs to be updated
1 parent 01a161a commit c144cf6

File tree

1 file changed

+106
-16
lines changed

1 file changed

+106
-16
lines changed

modules/ROOT/pages/database-administration/standard-databases/seed-from-uri.adoc

Lines changed: 106 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,31 @@ This method seeds all databases with an identical seed from an external source,
77

88
You specify the seed URI as an argument of the `CREATE DATABASE` command:
99

10-
[source, cypher]
10+
[.tabbed-example]
11+
=====
12+
[role=include-with-Cypher-5]
13+
======
14+
15+
[source, cypher5]
16+
----
17+
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI:'s3://myBucket/myBackup.backup' }
18+
----
19+
20+
======
21+
[role=include-with-Cypher-25 label--new-2025.06]
22+
======
23+
24+
[source, cypher25]
1125
----
1226
CREATE DATABASE foo OPTIONS { seedURI:'s3://myBucket/myBackup.backup' }
1327
----
28+
======
29+
=====
30+
31+
[NOTE]
32+
====
33+
The `existingData` option is required in Cypher 5 and deprecated in Cypher 25.
34+
====
1435

1536
Download and validation of the seed is only performed as the new database is started.
1637
If it fails, the database is not available and it has the `statusMessage`: `Unable to start database` of the `SHOW DATABASES` command.
@@ -70,7 +91,7 @@ The `URLConnectionSeedProvider` supports the following:
7091
** `https:`
7192

7293
Starting from Neo4j 2025.01, the `URLConnectionSeedProvider` does not support `file`.
73-
// This is true for both Cypher 5 and Cypher 25.
94+
This is true for both Cypher 5 and Cypher 25.
7495

7596

7697
[[cloud-seed-provider]]
@@ -96,7 +117,16 @@ include::partial$/aws-s3-credentials.adoc[]
96117

97118
. Create database from `myBackup.backup`.
98119
+
99-
[source,cypher]
120+
Using Cypher 5:
121+
+
122+
[source,cypher5]
123+
----
124+
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 's3://myBucket/myBackup.backup' }
125+
----
126+
+
127+
Using Cypher 25 label:new[Introduced in 2025.06]:
128+
+
129+
[source,cypher25]
100130
----
101131
CREATE DATABASE foo OPTIONS { seedURI: 's3://myBucket/myBackup.backup' }
102132
----
@@ -109,7 +139,16 @@ include::partial$/gcs-credentials.adoc[]
109139

110140
. Create database from `myBackup.backup`.
111141
+
112-
[source,cypher]
142+
Using Cypher 5:
143+
+
144+
[source,cypher5]
145+
----
146+
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 'gs://myBucket/myBackup.backup' }
147+
----
148+
+
149+
Using Cypher 25 label:new[Introduced in 2025.06]:
150+
+
151+
[source,cypher25]
113152
----
114153
CREATE DATABASE foo OPTIONS { seedURI: 'gs://myBucket/myBackup.backup' }
115154
----
@@ -121,15 +160,24 @@ include::partial$/azb-credentials.adoc[]
121160

122161
. Create database from `myBackup.backup`.
123162
+
124-
[source,cypher]
163+
Using Cypher 5:
164+
+
165+
[source,cypher5]
166+
----
167+
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 'azb://myStorageAccount/myContainer/myBackup.backup' }
168+
----
169+
+
170+
Using Cypher 25 label:new[Introduced in 2025.06]:
171+
+
172+
[source,cypher25]
125173
----
126174
CREATE DATABASE foo OPTIONS { seedURI: 'azb://myStorageAccount/myContainer/myBackup.backup' }
127175
----
128176
======
129177
=====
130178

131179

132-
[role=label--deprecated]
180+
[role=label--deprecated label--cypher-5]
133181
[[s3-seed-provider]]
134182
=== S3SeedProvider
135183

@@ -150,9 +198,10 @@ The `S3SeedProvider` requires additional configuration.
150198
This is specified with the `seedConfig` option, which expects a comma-separated list of configurations.
151199
Each configuration entry is specified in the format `key=value`, as such:
152200

153-
[source, cypher]
201+
[source, cypher5]
154202
----
155203
CREATE DATABASE foo OPTIONS {
204+
existingData: 'use',
156205
seedURI: 's3://myBucket/myBackup.backup',
157206
seedConfig: 'region=eu-west-1'
158207
}
@@ -165,9 +214,10 @@ For this to work, Neo4j on each server in the cluster must be configured with id
165214
This is identical to the configuration required by remote aliases, see xref:database-administration/aliases/remote-database-alias-configuration.adoc#remote-alias-config-DBMS_admin-A[Configuration of DBMS with remote database alias].
166215
Without this configuration, the `seedCredentials` option fails.
167216

168-
[source, cypher]
217+
[source, cypher5]
169218
----
170219
CREATE DATABASE foo OPTIONS {
220+
existingData: 'use',
171221
seedURI: 's3://myBucket/myBackup.backup',
172222
seedConfig: 'region=eu-west-1',
173223
seedCredentials: <accessKey>;<secretKey>
@@ -222,27 +272,67 @@ Starting from Neo4j 2025.01, when creating a database you can seed up to a speci
222272

223273
The `seedRestoreUntil` option is supported by the `CloudSeedProvider` and the `FileSeedProvider`.
224274

225-
226275
Seed up to a specific date::
227276

228-
To seed up to a specific date, you need to pass the differential backup, which contains the data up to that date.
277+
To seed up to a specific date, provide the differential backup containing the data up to that date.
229278
+
230-
[source,shell]
279+
[.tabbed-example]
280+
=====
281+
[role=include-with-Cypher-5]
282+
======
283+
[source,cypher5]
284+
----
285+
CREATE DATABASE foo OPTIONS {
286+
existingData: 'use',
287+
seedURI: 's3://myBucket/myBackup.backup',
288+
seedRestoreUntil: datetime('2019-06-01T18:40:32.142+0100')
289+
}
290+
----
291+
======
292+
[role=include-with-Cypher-25 label--new-2025.06]
293+
======
294+
295+
[source,cypher25]
231296
----
232-
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 's3://myBucket/myBackup.backup', seedRestoreUntil: datetime("2019-06-01T18:40:32.142+0100") }
297+
CREATE DATABASE foo OPTIONS {
298+
seedURI: 's3://myBucket/myBackup.backup',
299+
seedRestoreUntil: datetime('2019-06-01T18:40:32.142+0100')
300+
}
233301
----
302+
======
303+
=====
234304
+
235305
This will seed the database with transactions committed before the provided timestamp.
236306

237307

238308
Seed up to a specific transaction ID::
239309

240-
To seed up to a specific transaction ID, you need to pass the differential backup that contains the data up to that transaction ID.
310+
To seed up to a specific transaction ID, provide the differential backup containing the data up to that transaction ID.
241311
+
242-
[source,shell]
312+
[.tabbed-example]
313+
=====
314+
[role=include-with-Cypher-5]
315+
======
316+
[source,cypher5]
243317
----
244-
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 's3://myBucket/myBackup.backup', seedRestoreUntil: 123 }
318+
CREATE DATABASE foo OPTIONS {
319+
existingData: 'use',
320+
seedURI: 's3://myBucket/myBackup.backup',
321+
seedRestoreUntil: 123
322+
}
245323
----
324+
======
325+
[role=include-with-Cypher-25 label--new-2025.06]
326+
======
327+
[source,cypher25]
328+
----
329+
CREATE DATABASE foo OPTIONS {
330+
seedURI: 's3://myBucket/myBackup.backup',
331+
seedRestoreUntil: 123
332+
}
333+
----
334+
======
335+
=====
246336
+
247-
This will seed the database with transactions up to, but not including transaction 123.
337+
This will seed the database with transactions up to (but not including) transaction 123.
248338

0 commit comments

Comments
 (0)