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
Clarify how to restore a database backup in cluster (#3035)
Our restore documentation is very standalone minded. This PR attempts to
cover methods on how to restore a clustered database from a backup or
dump file.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/backup-restore/copy-database.adoc
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@
7
7
You can use the `neo4j-admin database copy` command to copy a database, create a compacted/defragmented copy of a database, clean up database inconsistencies, or do a direct migration from Neo4j 4.4 to any 5.x version.
8
8
`neo4j-admin database copy` reclaims the unused space, creates a defragmented copy of the _data store_, and creates the node label and relationship type lookup indexes.
9
9
10
+
[[neo4j-admin-copy-command-limitations]]
10
11
.Command limitations
11
12
[NOTE]
12
13
====
@@ -384,6 +385,78 @@ START DATABASE neo4j
384
385
For a detailed example of how to reclaim unused space, see xref:performance/space-reuse.adoc#space-reuse-reclaim-space[Reclaim unused space].
385
386
====
386
387
388
+
[role=label--new-2026.03]
389
+
[[copy-data-store-from-backup]]
390
+
=== Copy the data store from a backup
391
+
392
+
The following example assumes that you have a backup (created with the `neo4j-admin database backup` command) of your existing database `foo` in an AWS S3 bucket.
393
+
394
+
Before copying the database store from a backup, you do not need to stop or drop the database `foo`.
395
+
396
+
You can specify any differential backup in the chain.
397
+
Then the entire chain up to that point must be located in the same folder as the specified diff.
398
+
The chain will be found in the folder and all changes in that chain up to the point specified will be part of the result database from the copy operation.
399
+
If not, the command will fail due to incomplete chain.
400
+
401
+
[IMPORTANT]
402
+
====
403
+
`--source-location` and `--source-format` cannot be used together with `--from-path-data` and/or `--from-path-txn` due to the conflict in trying to supply data from two different locations at once.
404
+
405
+
The copy command does not copy over users and roles metadata.
406
+
You have to copy and re-apply them manually.
407
+
====
408
+
409
+
. Copy the data from a backup of your standard database `foo` into a backup for the database `foo-restored`.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/backup-restore/restore-backup.adoc
+59-13Lines changed: 59 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,40 @@
3
3
[[restore-backup]]
4
4
= Restore a database backup
5
5
6
+
Neo4j suggests a few options to restore a database backup artifact (full or differential) created with the xref:backup-restore/online-backup.adoc[`neo4j-admin database backup`] command.
7
+
8
+
== Restore a database on a standalone server
9
+
10
+
To restore a database from a backup in a standalone server environment, use one of the following methods:
11
+
12
+
* Use the <<restore-backup-command, `neo4j-admin database restore`>> command.
13
+
* Restore a database using URI approach.
14
+
See xref:database-administration/standard-databases/seed-from-uri.adoc[] for detailed information.
15
+
* Recreate a database using the xref:database-administration/standard-databases/recreate-database.adoc[`dbms.recreateDatabase()` procedure].
16
+
* label:new[Introduced in 2026.03] Use the xref:backup-restore/copy-database.adoc[`neo4j-admin database copy`] command to restore database data from a backup.
17
+
See xref:backup-restore/copy-database.adoc#copy-data-store-from-backup[Copy database data from a backup] for an example.
18
+
* You can also load a **full** database backup artifact using the xref:backup-restore/restore-dump.adoc[`neo4j-admin database load`] command.
19
+
This functionality is available in the Community Edition.
20
+
21
+
== Restore a clustered database from a backup
22
+
23
+
To restore a database from a backup in a clustered environment, use one of the following methods:
24
+
25
+
* Recreate a database from a URI.
26
+
See xref:clustering/databases.adoc#restore-database-using-uri-approach[Restore a database in cluster using URI approach] for more information.
27
+
* Designate one of the servers to be used as a seeder, and restore the database backup on that server.
28
+
For more information, see xref:clustering/databases.adoc#cluster-designated-seeder[Restore a database using a server as a designated seeder].
29
+
* Recreate a database using the `dbms.recreateDatabase()` procedure.
30
+
See xref:clustering/databases.adoc#restore-database-using-recreate-procedure[Restore a database using `dbms.recreateDatabase()`] for more details.
31
+
* label:new[Introduced in 2026.03] Use the xref:backup-restore/copy-database.adoc[`neo4j-admin database copy`] command.
32
+
See xref:clustering/databases.adoc#restore-database-using-copy-command[Restore a clustered database using the `copy` command] for more details.
33
+
6
34
[[restore-backup-command]]
7
35
== Command
8
36
9
37
A database backup artifact (full or differential) can be restored within the same or to a later Neo4j version using the `restore` command of `neo4j-admin`.
10
38
11
-
You can also load a **full** database backup artifact using the xref:backup-restore/restore-dump.adoc[`neo4j-admin database load`] command.
12
-
This functionality is available in the Community Edition.
13
-
14
-
[NOTE]
39
+
[IMPORTANT]
15
40
====
16
41
Restoring a database backup to a previous Neo4j version is not supported.
17
42
====
@@ -172,7 +197,7 @@ The `LOWEST TX` and `HIGHEST TX` columns show the transaction IDs of the first a
172
197
That means, if you restore `neo4j-2023-06-29T14-50-45.backup`, your database will have `14` as the last transaction ID.
173
198
174
199
175
-
=== Restore a database backup
200
+
=== Restore a backup on a standalone server
176
201
177
202
The following examples assume that you want to restore your data in a new database, called `mydatabase`.
178
203
If you want to replace an existing database, you need to stop it first and add the option `--overwrite-destination=true` to the restore command.
@@ -235,6 +260,7 @@ For example, `--restore-until=123`.
235
260
CREATE DATABASE mydatabase;
236
261
----
237
262
263
+
238
264
[[restore-cloud-storage]]
239
265
=== Restore a backup located in cloud storage
240
266
@@ -261,6 +287,14 @@ The example assumes that you have backup artifacts located in the `myBucket/myDi
. If you have not stopped your database and used the `--overwrite-destination=true` option, you have to create the new `mydatabase` by running the command:
292
+
+
293
+
[source,cypher]
294
+
----
295
+
CREATE DATABASE mydatabase;
296
+
----
297
+
264
298
======
265
299
266
300
[role=include-with-Google-cloud-storage]
@@ -275,6 +309,14 @@ The example assumes that you have backup artifacts located in the `myBucket/myDi
. If you have not stopped your database and used the `--overwrite-destination=true` option, you have to create the new `mydatabase` by running the command:
314
+
+
315
+
[source,cypher]
316
+
----
317
+
CREATE DATABASE mydatabase;
318
+
----
319
+
278
320
======
279
321
280
322
[role=include-with-Azure-cloud-storage]
@@ -289,20 +331,23 @@ The example assumes that you have backup artifacts located in the `myStorageAcco
. If you have not stopped your database and used the `--overwrite-destination=true` option, you have to create the new `mydatabase` by running the command:
336
+
+
337
+
[source,cypher]
338
+
----
339
+
CREATE DATABASE mydatabase;
340
+
----
341
+
292
342
======
293
343
=====
294
344
295
-
=== Restore a database backup in a cluster
296
345
297
-
To restore a database backup in a cluster, designate one of the servers to be used as a seeder, and restore the database backup on that server.
298
-
Then, use that server to create the restored database on other servers in the cluster.
299
-
For more information, see xref:clustering/databases.adoc#cluster-seed[Designated seeder].
346
+
== Restore users and roles metadata
300
347
301
-
=== Restore users and roles metadata
348
+
Users, roles, and auth rules metadata are backed up during the backup process by default.
302
349
303
-
If you have backed up a database with the option `--include-metadata`, you can manually restore the users, roles, and auth rules metadata.
304
-
305
-
From the _<NEO4J_HOME>_ directory, you run the Cypher script _/data/scripts/databasename/restore_metadata.cypher_, which the `neo4j-admin database restore` command outputs, using xref:cypher-shell.adoc[]:
350
+
If you need to restore the users and roles metadata, you have to do it manually by running the Cypher script from the _<NEO4J_HOME>_ directory, _/data/scripts/databasename/restore_metadata.cypher_, which the `neo4j-admin database restore` command outputs, using xref:cypher-shell.adoc[]:
306
351
307
352
*Using `cat` (UNIX)*
308
353
[source, shell, role=nocopy noplay]
@@ -315,3 +360,4 @@ cat ../data/scripts/databasename/restore_metadata.cypher | bin/cypher-shell -u u
315
360
----
316
361
type ..\data\scripts\databasename\restore_metadata.cypher | bin\cypher-shell.bat -u user -p password -a ip_address:port -d system --param "database => 'databasename'"
Copy file name to clipboardExpand all lines: modules/ROOT/pages/backup-restore/restore-dump.adoc
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
The `neo4j-admin database load` command can be used to load a database from an archive created with the xref:backup-restore/offline-backup.adoc#offline-backup-command[`neo4j-admin database dump`] command or a full backup artifact created by the xref:backup-restore/online-backup.adoc[`neo4j-admin database backup`] command from Neo4j Enterprise.
6
6
7
-
If you are replacing an existing database, you have to shut it down before running the command and use the `--overwrite-destination` option. +
7
+
If you are replacing an existing database on a standalone server, you have to shut it down before running the command and use the `--overwrite-destination` option. +
8
8
label:enterprise-edition[] If you are not replacing an existing database, you must create the database (using `CREATE DATABASE` against the `system` database) after the load operation finishes.
9
9
10
10
The command can be run from either an online or offline Neo4j DBMS on Enterprise edition.
@@ -108,15 +108,8 @@ The `--overwrite-destination` option is required because you are replacing the e
108
108
109
109
If you are not replacing an existing database in Enterprise Edition, you must create the database (using `CREATE DATABASE` against the `system` database) after the load operation finishes.
110
110
111
-
[NOTE]
112
-
====
113
-
When using the `load` command to seed a cluster, and a previous version of the database exists, you must delete it (using `DROP DATABASE`) first.
114
-
Alternatively, you can stop the Neo4j instance and unbind it from the cluster using `neo4j-admin server unbind` to remove its cluster state data.
115
-
If you fail to DROP or unbind before loading the dump, that database’s store files will be out of sync with its cluster state, potentially leading to logical corruptions.
116
-
For more information, see xref:clustering/databases.adoc#cluster-seed[Seed a cluster].
117
-
====
118
111
119
-
[NOTE]
112
+
[IMPORTANT]
120
113
====
121
114
`neo4j-admin database load` cannot be applied to xref:scalability/composite-databases/concepts.adoc[Composite databases].
122
115
It must be run directly on the databases that are associated with that Composite database.
It is recommended to restore a clustered database from a dump using a URI approach.
202
+
See xref:database-administration/standard-databases/seed-from-uri.adoc[] for details.
203
+
204
+
When using the `neo4j-admin database load` command to seed a cluster, and a previous version of the database exists, you must delete it (using `DROP DATABASE`) first.
205
+
If you fail to `DROP` the database, that database’s store files will be out of sync with its cluster state, potentially leading to logical corruptions.
206
+
For more information, see xref:clustering/databases.adoc#cluster-designated-seeder[Restore a database using a designated seeder].
0 commit comments