Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions modules/ROOT/pages/backup-restore/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ This chapter describes the following:

* xref:backup-restore/planning.adoc[Backup and restore planning] -- What to consider when designing your backup and restore strategy.
* xref:backup-restore/modes.adoc[Backup modes] -- The supported backup modes.
* xref:backup-restore/online-backup.adoc[Back up an online database] -- How to back up an online database.
* xref:backup-restore/aggregate.adoc[Aggregate a database backup chain] - How to aggregate a backup chain into a single backup.
* xref:backup-restore/inspect.adoc[Inspect the metadata of a database backup file] -- How to inspect the metadata of a database backup file.
* label:enterprise[Enterprise Edition] xref:backup-restore/online-backup.adoc[Back up an online database] -- How to back up an online database.
* label:enterprise[Enterprise Edition] xref:backup-restore/aggregate.adoc[Aggregate a database backup chain] - How to aggregate a backup chain into a single backup.
* label:enterprise[Enterprise Edition] xref:backup-restore/inspect.adoc[Inspect the metadata of a database backup file] -- How to inspect the metadata of a database backup file.
* xref:backup-restore/consistency-checker.adoc[Check database consistency] -- How to check the consistency of a database, backup, or a dump.
* xref:backup-restore/restore-backup.adoc[Restore a database backup] -- How to restore a database backup in a live Neo4j deployment.
* label:enterprise[Enterprise Edition] xref:backup-restore/restore-backup.adoc[Restore a database backup] -- How to restore a database backup in a live Neo4j deployment.
* xref:backup-restore/offline-backup.adoc[Back up an offline database] -- How to back up an offline database.
* xref:backup-restore/restore-dump.adoc[Restore a database dump] -- How to restore a database dump in a live Neo4j deployment.
* xref:backup-restore/copy-database.adoc[Copy a database store] -- How to copy data store from an existing database to a new database.
* label:enterprise[Enterprise Edition] xref:backup-restore/copy-database.adoc[Copy a database store] -- How to copy data store from an existing database to a new database.
//* <<backup-restore-single, Backup and restore a single database>>
//* <<backup-restore-cluster-member, Backup and restore a cluster member>>
//* <<backup-restore-cluster, Backup and restore a Causal cluster>>
Expand Down
34 changes: 21 additions & 13 deletions modules/ROOT/pages/backup-restore/modes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
[[backup-modes]]
= Backup modes

The backup client can operate in two different modes – a _full backup_ and an _differential backup_.
The backup client can operate in two different modes – a _full backup_ and a _differential backup_.

[[full-backup]]
== Full backup

A full backup is always required initially for the very first backup into a target location.

[NOTE]
====
The full backup can be run against both an *online* (using `neo4j-admin database backup`) and an *offline* (using `neo4j-admin database dump`) database.
====
The full backup can be run against an *online* (using the Enterprise edition command -- `neo4j-admin database backup`) and an *offline* (using `neo4j-admin database dump`) database.


[role=enterprise-edition]
=== `neo4j-admin database backup`

.Full backup against an online database
.Backing up an online database
====
[source,shell,role=nocopy]
----
Expand All @@ -31,21 +32,29 @@ Doing full backup...
...
----
====

The `neo4j-admin database backup` command with the `--type=full` argument creates a xref:backup-restore/online-backup.adoc#backup-artifact[full backup artifact] file in the format of _<databasename><timestamp>.backup_, in the target location specified by `--to-path`.

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

The `neo4j-admin database backup` command allows you to include metadata, enabling the backup to store the role-based access control (RBAC) settings associated with the database.
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
The `neo4j-admin database backup` command allows you to include metadata, enabling the backup to store the role-based access control (RBAC) settings associated with the database.
By default, the backup file also contains the users and roles metadata associated with the database.
You can change whether you want it to be included or not using the argument `--include-metadata`.


For more information about online backup options and how to control memory usage, see xref:backup-restore/online-backup.adoc[Back up an online database].

[NOTE]
====
A full online database backup creates a xref:backup-restore/online-backup.adoc#backup-artifact[full backup artifact] in the target location (`--to-path`).
====

=== `neo4j-admin database dump`

The `neo4j-admin database dump` command creates a single-file archive, that follows the format _<databasename><timestamp>.dump_, and stores it in the xref:configuration/file-locations.adoc#data[_<NEO4J_HOME>/data_] directory.

Note that when using `neo4j-admin database dump`, only the database contents are backed up; the associated users and roles metadata are not included.

For more information about performing a full backup against an *offline* database, see xref:backup-restore/offline-backup.adoc[Back up an offline database].


[role=enterprise-edition]
[[differential-backup]]
== Differential backup


In the online backup version, after the initial full backup, the subsequent backups attempt to use the differential mode, where just the delta of the transaction logs since the last backup are transferred and used to create a differential backup artifact (stored in the target location). Those differential backup artifacts form a xref:backup-restore/online-backup.adoc#backup-chain[backup chain].
In the online backup version, after the initial full backup, subsequent backups attempt to use differential mode, where only the delta of the transaction logs since the last backup is transferred and used to create a differential backup artifact (stored in the target location).
Those differential backup artifacts form a xref:backup-restore/online-backup.adoc#backup-chain[backup chain].
If the required transaction logs are not available on the backup server, then the backup client falls back on performing a full backup instead.


Expand All @@ -60,4 +69,3 @@ Backup complete.
----
====

For more information about online backup options and how to control memory usage, see xref:backup-restore/online-backup.adoc[Back up an online database].
5 changes: 4 additions & 1 deletion modules/ROOT/pages/backup-restore/offline-backup.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ Remember to xref:backup-restore/planning.adoc[plan your backup] carefully and ba
== Command

The `neo4j-admin database dump` command can be used for performing a full backup of an **offline** database.
It dumps a database into a single-file archive, called _<database>.dump_, and stores it in the xref:configuration/file-locations.adoc#data[_<NEO4J_HOME>/data_] directory.
It dumps only the database content into a single-file archive, called _<database>.dump_, and stores it in the xref:configuration/file-locations.adoc#data[_<NEO4J_HOME>/data_] directory.
Note that the `neo4j-admin database dump` command **does not** support backing up users and roles metadata.

Alternatively, `neo4j-admin database dump` can stream dump to standard output, enabling the output to be piped to another program, for example to `neo4j-admin database load`.

If the database is hosted in a cluster, make sure that the database is stopped on the server you are connected to.
The command can be run only locally from an online or an offline Neo4j DBMS on Enterprise Edition.
On Community Edition, the command can be run only on an offline Neo4j DBMS.
It does not support SSL/TLS.


[[offline-command-syntax]]
=== Syntax

Expand Down
8 changes: 4 additions & 4 deletions modules/ROOT/pages/backup-restore/online-backup.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:description: This section describes how to back up an online database.
[role=enterprise-edition]
[role=enterprise-edition not-on-aura]
[[online-backup]]
= Back up an online database

Expand Down Expand Up @@ -434,7 +434,7 @@ bin/neo4j-admin database backup --to-path=/path/to/backups/neo4j neo4j
----


=== Perform a forced full backup of a single database.
=== Perform a forced full backup of a single database

If you want to force a full backup after several differential backups, you can use the `--type=full` option.

Expand All @@ -446,8 +446,8 @@ bin/neo4j-admin database backup --type=full --to-path=/path/to/backups/neo4j neo

=== Back up multiple databases

To back up several databases that match database a pattern you can use name globbing.
For example, to backup all databases that start with *n* from your three-node cluster, run:
To back up multiple databases that match a name pattern, you can use name globbing.
For example, to backup all databases that start with *n* in your three-server cluster, run:

[source, shell,role=nocopy noplay]
----
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/backup-restore/planning.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ The recommended way to restore a database in a cluster is to xref::database-admi
[IMPORTANT]
====
By default, a database backup includes only the database contents.
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
By default, a database backup includes only the database contents.
By default, when backing up a database using the `neo4j-admin database backup` command (Enterprise edition), the backup archive includes both the database contents and the users and roles metadata.
You can control whether you want to include the users, roles, all, or none using the argument xref:backup-restore/online-backup.adoc#backup-command-options[`--include-metadata`].

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 might be wrong, but you have to specify --include-metadata if you want to back up users' roles and privileges (on a database level). If you use just --include-metadata, the default value is all meaning that both users and roles are included. But anyway you have to include --include-metadata flag in your backup command. If you just run bin/neo4j-admin database backup --to-path=/path/to/backups/neo4j neo4j, no metadata is included.

If you choose to include metadata, the backup also stores the role-based access control (RBAC) settings associated with the database.
In the Enterprise edition, the `neo4j-admin database backup` command also allows you to include metadata, enabling the backup to store the role-based access control (RBAC) settings associated with the database.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It backs the metadata by default. Actually, it allows you to not include it if you want. Also, I'm not sure what we meant by settings "? I added a suggestion for the above sentence.

Suggested change
In the Enterprise edition, the `neo4j-admin database backup` command also allows you to include metadata, enabling the backup to store the role-based access control (RBAC) settings associated with the database.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Where do we say that that metadata is backed up by 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.

See https://neo4j.com/docs/operations-manual/current/backup-restore/restore-backup/#_restore_users_and_roles_metadata.
It says If you have backed up a database with the option --include-metadata, you can manually restore the users and roles metadata.
I assume it means you must include the option --include-metadata into your backup command. Without this option, the backup file doesn't contain file with users and their roles.


When restoring, you have the flexibility to define the target topology (how many primaries and secondaries are desired for the database), which may differ from the topology at backup time.
The database will then be allocated across the available servers according to that topology.
Expand Down