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

Update the step to stop PITR #237

Merged
merged 1 commit into from
Dec 3, 2024
Merged
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: 2 additions & 8 deletions docs/usage/pitr-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@

## Before you start

1. Disable point-in-time recovery. A restore and point-in-time recovery oplog slicing are incompatible operations and cannot be run simultaneously.

```{.bash data-prompt="$"}
$ pbm config --set pitr.enabled=false
```

2. Stop the balancer and `mongos` nodes.
3. Make sure no writes are made to the database during restore.
1. Stop the balancer and `mongos` nodes.
2. Make sure no writes are made to the database during restore.

Check notice on line 10 in docs/usage/pitr-tutorial.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/usage/pitr-tutorial.md#L10

[Google.Passive] In general, use active voice instead of passive voice ('are made').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are made').", "location": {"path": "docs/usage/pitr-tutorial.md", "range": {"start": {"line": 10, "column": 24}}}, "severity": "INFO"}

## Procedure

Expand Down
35 changes: 20 additions & 15 deletions docs/usage/restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,19 @@ To restore a backup, use the [`pbm restore`](../reference/pbm-commands.md#pbm-re

1. While the restore is running, prevent clients from accessing the database. The data will naturally be incomplete while the restore is in progress, and writes the clients make cause the final restored data to differ from the backed-up data.

2. For versions 2.3.1 and earlier, disable [Point-in-time recovery](../features/point-in-time-recovery.md) before running `pbm restore`. This is because Point-in-Time recovery oplog slicing and restore are incompatible operations and cannot be run together.

3. Backups made with Percona Backup for MongoDB prior to v1.5.0 are incompatible for restore with Percona Backup for MongoDB v1.5.0 and later. This is because processing of system collections `Users` and `Roles` has changed: in v1.5.0, `Users` and `Roles` are copied to temporary collection during backup and must be present in the backup during restore. In earlier versions of Percona Backup for MongoDB, `Users` and `Roles` are copied to a temporary collection during restore. Therefore, restoring from these backups with Percona Backup for MongoDB v1.5.0 isn’t possible.
2. Backups made with Percona Backup for MongoDB prior to v1.5.0 are incompatible for restore with Percona Backup for MongoDB v1.5.0 and later. This is because processing of system collections `Users` and `Roles` has changed: in v1.5.0, `Users` and `Roles` are copied to temporary collection during backup and must be present in the backup during restore. In earlier versions of Percona Backup for MongoDB, `Users` and `Roles` are copied to a temporary collection during restore. Therefore, restoring from these backups with Percona Backup for MongoDB v1.5.0 isn’t possible.

The recommended approach is to make a fresh backup after upgrading Percona Backup for MongoDB to version 1.5.0.

4. For versions earlier than 1.x, Percona Backup for MongoDB performs a full all-databases, all collections restore and does not offer an option to restore only a subset of collections in the backup, as MongoDB’s `mongodump` tool does.
3. For versions earlier than 1.x, Percona Backup for MongoDB performs a full all-databases, all collections restore and does not offer an option to restore only a subset of collections in the backup, as MongoDB’s `mongodump` tool does.

5. Starting with versions 1.x, Percona Backup for MongoDB replicates `mongodump’s` behavior to only drop collections in the backup. It does not drop collections that are created new after the time of the backup and before the restore. Run a `db.dropDatabase()` manually in all non-system databases (these are all databases except “local”, “config” and “admin”) before running `pbm restore` if you want to guarantee that the post-restore database only includes collections that are in the backup.
4. Starting with versions 1.x, Percona Backup for MongoDB replicates `mongodump’s` behavior to only drop collections in the backup. It does not drop collections that are created new after the time of the backup and before the restore. Run a `db.dropDatabase()` manually in all non-system databases (these are all databases except “local”, “config” and “admin”) before running `pbm restore` if you want to guarantee that the post-restore database only includes collections that are in the backup.

=== ":material-database-refresh-outline: Physical"

1. Disable point-in-time recovery. A restore and point-in-time recovery oplog slicing are incompatible operations and cannot be run simultaneously.

```{.bash data-prompt="$"}
$ pbm config --set pitr.enabled=false
```

2. The Percona Server for MongoDB version for both backup and restore data must be within the same major release.
3. Make sure all nodes in the cluster are healthy (i.e. either PRIMARY or SECONDARY). Each pbm-agent needs to be able to connect to its local node and run queries in order to perform the restore.
4. For PBM versions before 2.1.0, physical restores are not supported for deployments with arbiter nodes.
1. The Percona Server for MongoDB version for both backup and restore data must be within the same major release.
2. Make sure all nodes in the cluster are healthy (i.e. either PRIMARY or SECONDARY). Each pbm-agent needs to be able to connect to its local node and run queries in order to perform the restore.
3. For PBM versions before 2.1.0, physical restores are not supported for deployments with arbiter nodes.

=== ":simple-databricks: Incremental"

Expand Down Expand Up @@ -65,13 +57,26 @@ To restore a backup, use the [`pbm restore`](../reference/pbm-commands.md#pbm-re

3. Shut down all `pmm-agent` and other clients that can do the write operations to the database. This is required to ensure data consistency after the restore.

4. For PBM version 2.3.1 and earlier, manually disable point-in-time recovery if it is enabled. To learn more about point-in-time recovery, see [Point-in-time recovery](../features/point-in-time-recovery.md).
4. For PBM version 2.3.1 and earlier, manually disable point-in-time recovery if it is enabled.

```{.bash data-prompt="$"}
$ pbm config --set pitr.enabled=false
```

To learn more about point-in-time recovery, see [Point-in-time recovery](../features/point-in-time-recovery.md).

=== ":material-database-refresh-outline: Physical"

1. Shut down all `mongos` nodes as the database won't be available while the restore is in progress.
2. Shut down all `pmm-agent` and other clients that can do the write operations to the database. This is required to ensure data consistency after the restore.
3. Stop the arbiter nodes manually since there's no `pbm-agent` on these nodes to do that automatically.
4. For PBM version 2.3.1 and earlier, manually disable point-in-time recovery if it is enabled.

```{.bash data-prompt="$"}
$ pbm config --set pitr.enabled=false
```

To learn more about point-in-time recovery, see [Point-in-time recovery](../features/point-in-time-recovery.md).

=== ":material-select-multiple: Selective"

Expand Down
Loading