Skip to content

Commit 4241bc3

Browse files
Fix Cypher examples to show its both versions
1 parent ba6caca commit 4241bc3

File tree

1 file changed

+93
-11
lines changed

1 file changed

+93
-11
lines changed

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

Lines changed: 93 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,28 @@ 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]
22+
======
23+
24+
[source, cypher25]
1125
----
1226
CREATE DATABASE foo OPTIONS { seedURI:'s3://myBucket/myBackup.backup' }
1327
----
28+
======
29+
=====
30+
31+
Note that the `existingData` option is required in Cypher 5 and deprecated in Cypher 25.
1432

1533
Download and validation of the seed is only performed as the new database is started.
1634
If it fails, the database is not available and it has the `statusMessage`: `Unable to start database` of the `SHOW DATABASES` command.
@@ -96,7 +114,16 @@ include::partial$/aws-s3-credentials.adoc[]
96114

97115
. Create database from `myBackup.backup`.
98116
+
99-
[source,cypher]
117+
Using Cypher 5:
118+
+
119+
[source,cypher5]
120+
----
121+
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 's3://myBucket/myBackup.backup' }
122+
----
123+
+
124+
Using Cypher 25:
125+
+
126+
[source,cypher25]
100127
----
101128
CREATE DATABASE foo OPTIONS { seedURI: 's3://myBucket/myBackup.backup' }
102129
----
@@ -109,7 +136,16 @@ include::partial$/gcs-credentials.adoc[]
109136

110137
. Create database from `myBackup.backup`.
111138
+
112-
[source,cypher]
139+
Using Cypher 5:
140+
+
141+
[source,cypher5]
142+
----
143+
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 'gs://myBucket/myBackup.backup' }
144+
----
145+
+
146+
Using Cypher 25:
147+
+
148+
[source,cypher25]
113149
----
114150
CREATE DATABASE foo OPTIONS { seedURI: 'gs://myBucket/myBackup.backup' }
115151
----
@@ -121,7 +157,16 @@ include::partial$/azb-credentials.adoc[]
121157

122158
. Create database from `myBackup.backup`.
123159
+
124-
[source,cypher]
160+
Using Cypher 5:
161+
+
162+
[source,cypher5]
163+
----
164+
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 'azb://myStorageAccount/myContainer/myBackup.backup' }
165+
----
166+
+
167+
Using Cypher 25:
168+
+
169+
[source,cypher25]
125170
----
126171
CREATE DATABASE foo OPTIONS { seedURI: 'azb://myStorageAccount/myContainer/myBackup.backup' }
127172
----
@@ -133,38 +178,73 @@ CREATE DATABASE foo OPTIONS { seedURI: 'azb://myStorageAccount/myContainer/myBac
133178

134179
Starting from Neo4j 2025.01, the `CloudSeedProvider` supports seeding up to a specific date or transaction ID using the `seedRestoreUntil` option.
135180

136-
[role=label--new-2025.01]
181+
137182
Seed up to a specific date::
138183

139184
To seed up to a specific date, provide the differential backup containing the data up to that date.
140185
+
141-
[source,cypher]
186+
[.tabbed-example]
187+
=====
188+
[role=include-with-Cypher-5]
189+
======
190+
[source,cypher5]
191+
----
192+
CREATE DATABASE foo OPTIONS {
193+
existingData: 'use',
194+
seedURI: 's3://myBucket/myBackup.backup',
195+
seedRestoreUntil: datetime('2019-06-01T18:40:32.142+0100')
196+
}
197+
----
198+
======
199+
[role=include-with-Cypher-25]
200+
======
201+
202+
[source,cypher25]
142203
----
143204
CREATE DATABASE foo OPTIONS {
144205
seedURI: 's3://myBucket/myBackup.backup',
145206
seedRestoreUntil: datetime('2019-06-01T18:40:32.142+0100')
146207
}
147208
----
209+
======
210+
=====
148211
+
149212
This will seed the database with transactions committed before the provided timestamp.
150213

151-
[role=label--new-2025.01]
214+
152215
Seed up to a specific transaction ID::
153216

154217
To seed up to a specific transaction ID, provide the differential backup containing the data up to that transaction ID.
155218
+
156-
[source,cypher]
219+
[.tabbed-example]
220+
=====
221+
[role=include-with-Cypher-5]
222+
======
223+
[source,cypher5]
224+
----
225+
CREATE DATABASE foo OPTIONS {
226+
existingData: 'use',
227+
seedURI: 's3://myBucket/myBackup.backup',
228+
seedRestoreUntil: 123
229+
}
230+
----
231+
======
232+
[role=include-with-Cypher-25]
233+
======
234+
[source,cypher25]
157235
----
158236
CREATE DATABASE foo OPTIONS {
159237
seedURI: 's3://myBucket/myBackup.backup',
160238
seedRestoreUntil: 123
161239
}
162240
----
241+
======
242+
=====
163243
+
164244
This will seed the database with transactions up to (but not including) transaction 123.
165245

166246

167-
[role=label--deprecated]
247+
[role=label--deprecated label--cypher-5]
168248
[[s3-seed-provider]]
169249
=== S3SeedProvider
170250

@@ -185,9 +265,10 @@ The `S3SeedProvider` requires additional configuration.
185265
This is specified with the `seedConfig` option, which expects a comma-separated list of configurations.
186266
Each configuration entry is specified in the format `key=value`, as such:
187267

188-
[source, cypher]
268+
[source, cypher5]
189269
----
190270
CREATE DATABASE foo OPTIONS {
271+
existingData: 'use',
191272
seedURI: 's3://myBucket/myBackup.backup',
192273
seedConfig: 'region=eu-west-1'
193274
}
@@ -200,9 +281,10 @@ For this to work, Neo4j on each server in the cluster must be configured with id
200281
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].
201282
Without this configuration, the `seedCredentials` option fails.
202283

203-
[source, cypher]
284+
[source, cypher5]
204285
----
205286
CREATE DATABASE foo OPTIONS {
287+
existingData: 'use',
206288
seedURI: 's3://myBucket/myBackup.backup',
207289
seedConfig: 'region=eu-west-1',
208290
seedCredentials: <accessKey>;<secretKey>

0 commit comments

Comments
 (0)