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

Add example on how to CREATE db from the seed URI #2152

Closed
wants to merge 10 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,19 @@ Replaced by `existingDataSeedServer`.
|
Defines an identical seed from an external source which will be used to seed all servers.

For examples, see xref::clustering/databases.adoc#cluster-seed-uri[Seed from URI].

| `seedConfig`
| Comma-separated list of configuration values.
|
For more information see xref::clustering/databases.adoc#cluster-seed-uri[Seed from URI].


| `seedCredentials` label:deprecated[Deprecated in 5.26]
| credentials
|
Defines credentials that need to be passed into certain seed providers.
It is recommended to use the `CloudSeedProvider` seed provider, which does not require this configuration when seeding from cloud storage.
For more information see xref::clustering/databases.adoc#cloud-seed-provider[CloudSeedProvider].
For more information, see xref::clustering/databases.adoc#cloud-seed-provider[CloudSeedProvider].

| `txLogEnrichment`
| `FULL` \| `DIFF` \| `OFF`
Expand Down Expand Up @@ -214,6 +216,55 @@ The `IF NOT EXISTS` and `OR REPLACE` parts of these commands cannot be used toge
====


==== Create databases using seeding options

Neo4j has built-in support for a seed from a mounted file system (file), FTP server, HTTP/HTTPS server, Amazon S3, Google Cloud Storage, and Azure Cloud Storage.
To select a seed provider, you need to configure xref:configuration/configuration-settings.adoc#config_dbms.databases.seed_from_uri_providers[dbms.databases.seed_from_uri_providers].

For more information on seeding from URI, refer to xref::clustering/databases.adoc#cluster-seed-uri[Manage databases in a cluster -> Seed from URI].

.Seed providers supported in Neo4j
[cols="2,1,2",options="header"]
|===
| Seed provider
| URL scheme
| URI example

| `FileSeedProvider`
| `file:`
| `file:/tmp/backup1.backup`

| `URLConnectionSeedProvider`
| `ftp:` +
`http:` +
`https:`
| `ftp:://myftp.com/backups/backup1.backup` +
`/http://myhttp.com/backups/backup1.backup` +
`/https://myhttp.com/backups/backup1.backup`

| `S3SeedProvider` label:deprecated[Deprecated in 5.26]
| `s3:`
| `s3://mybucket/backups/backup1.backup`

| `CloudSeedProvider`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `CloudSeedProvider`
| `CloudSeedProvider` label:default[Default]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about using the Default label here. This is confusing. I think it will cause more questions than provide clarification.

Copy link
Collaborator Author

@NataliaIvakina NataliaIvakina Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default value of the config starting from 2025.01 only. I don't think we need such details here.

| `s3:` +
`gs:` +
`azb:`
| `s3://mybucket/backups/backup1.backup` +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, there is a mismatch between the examples and this table here and on the other page. In the examples, the URLs are s3:/mybucket/backups/backup1.backup, gs:/mybucket/backups/backup1.backup, and azb:/mystorageaccount.blob/backupscontainer/backup1.backup, while in the tables we see double // after the s3, gs, and azb. I am not sure which one is correct.

Copy link
Collaborator Author

@NataliaIvakina NataliaIvakina Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, interesting indeed. If you look at the examples here, you'll see we use double slashes after s3:, gs:, and azb:.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't know now. Maybe you can ask someone.

`gs://mybucket/backups/backup1.backup` +
`azb://mystorageaccount.blob/backupscontainer/backup1.backup`
|===


The following example shows how to create a database using the URI of the seed:

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

Starting from Neo4j 2025.01, seed from URI can also be used in combination with `CREATE OR REPLACE DATABASE`.

[[manage-databases-start]]
== Start databases

Expand Down