Skip to content
Merged
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,31 @@ This method seeds all databases with an identical seed from an external source,

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

[source, cypher]
[.tabbed-example]
=====
[role=include-with-Cypher-5]
======

[source, cypher5]
----
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI:'s3://myBucket/myBackup.backup' }
----

======
[role=include-with-Cypher-25]
======

[source, cypher25]
----
CREATE DATABASE foo OPTIONS { seedURI:'s3://myBucket/myBackup.backup' }
----
======
=====

[NOTE]
====
The `existingData` option is required in Cypher 5 and deprecated in Cypher 25.
====

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

Starting from Neo4j 2025.01, the `URLConnectionSeedProvider` does not support `file`.
// This is true for both Cypher 5 and Cypher 25.
This is true for both Cypher 5 and Cypher 25.


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

. Create database from `myBackup.backup`.
+
[source,cypher]
Using Cypher 5:
+
[source,cypher5]
----
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 's3://myBucket/myBackup.backup' }
----
+
Using Cypher 25:
+
[source,cypher25]
----
CREATE DATABASE foo OPTIONS { seedURI: 's3://myBucket/myBackup.backup' }
----
Expand All @@ -109,7 +139,16 @@ include::partial$/gcs-credentials.adoc[]

. Create database from `myBackup.backup`.
+
[source,cypher]
Using Cypher 5:
+
[source,cypher5]
----
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 'gs://myBucket/myBackup.backup' }
----
+
Using Cypher 25:
+
[source,cypher25]
----
CREATE DATABASE foo OPTIONS { seedURI: 'gs://myBucket/myBackup.backup' }
----
Expand All @@ -121,15 +160,24 @@ include::partial$/azb-credentials.adoc[]

. Create database from `myBackup.backup`.
+
[source,cypher]
Using Cypher 5:
+
[source,cypher5]
----
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 'azb://myStorageAccount/myContainer/myBackup.backup' }
----
+
Using Cypher 25:
+
[source,cypher25]
----
CREATE DATABASE foo OPTIONS { seedURI: 'azb://myStorageAccount/myContainer/myBackup.backup' }
----
======
=====


[role=label--deprecated]
[role=label--deprecated label--cypher-5]
[[s3-seed-provider]]
=== S3SeedProvider

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

[source, cypher]
[source, cypher5]
----
CREATE DATABASE foo OPTIONS {
existingData: 'use',
seedURI: 's3://myBucket/myBackup.backup',
seedConfig: 'region=eu-west-1'
}
Expand All @@ -165,9 +214,10 @@ For this to work, Neo4j on each server in the cluster must be configured with id
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].
Without this configuration, the `seedCredentials` option fails.

[source, cypher]
[source, cypher5]
----
CREATE DATABASE foo OPTIONS {
existingData: 'use',
seedURI: 's3://myBucket/myBackup.backup',
seedConfig: 'region=eu-west-1',
seedCredentials: <accessKey>;<secretKey>
Expand Down Expand Up @@ -222,27 +272,65 @@ Starting from Neo4j 2025.01, when creating a database you can seed up to a speci

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


Seed up to a specific date::

To seed up to a specific date, you need to pass the differential backup, which contains the data up to that date.
To seed up to a specific date, provide the differential backup containing the data up to that date.
+
[source,shell]
[.tabbed-example]
=====
[role=include-with-Cypher-5]
======
[source,cypher5]
----
CREATE DATABASE foo OPTIONS {
existingData: 'use',
seedURI: 's3://myBucket/myBackup.backup',
seedRestoreUntil: datetime('2019-06-01T18:40:32.142+0100')
}
----
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 's3://myBucket/myBackup.backup', seedRestoreUntil: datetime("2019-06-01T18:40:32.142+0100") }
======
[role=include-with-Cypher-25]
======

[source,cypher25]
----
CREATE DATABASE foo OPTIONS {
seedURI: 's3://myBucket/myBackup.backup',
seedRestoreUntil: datetime('2019-06-01T18:40:32.142+0100')
}
----
======
=====
+
This will seed the database with transactions committed before the provided timestamp.


Seed up to a specific transaction ID::

To seed up to a specific transaction ID, you need to pass the differential backup that contains the data up to that transaction ID.
To seed up to a specific transaction ID, provide the differential backup containing the data up to that transaction ID.
+
[source,shell]
[.tabbed-example]
=====
[role=include-with-Cypher-5]
======
[source,cypher5]
----
CREATE DATABASE foo OPTIONS {
existingData: 'use',
seedURI: 's3://myBucket/myBackup.backup',
seedRestoreUntil: 123
}
----
CREATE DATABASE foo OPTIONS { existingData: 'use', seedURI: 's3://myBucket/myBackup.backup', seedRestoreUntil: 123 }
======
[role=include-with-Cypher-25]
======
[source,cypher25]
----
CREATE DATABASE foo OPTIONS {
seedURI: 's3://myBucket/myBackup.backup',
seedRestoreUntil: 123
}
----
======
=====
+
This will seed the database with transactions up to, but not including transaction 123.
This will seed the database with transactions up to (but not including) transaction 123.