Este contenido no está disponible en el idioma seleccionado.
Chapter 5. Recovering from data loss with IdM backups
Restore an Identity Management (IdM) server or its LDAP data to a previous state using the ipa-restore utility.
5.1. Restoring an IdM server from a backup Copiar enlaceEnlace copiado en el portapapeles!
Using the ipa-restore utility, you can restore your IdM server or the LDAP content to the state they were in when the backup was created.
Figure 5.1. Replication topology used in this example
This example restoration scenario involves the following three servers:
-
server1.example.com: The server that you want to restore from backup. -
caReplica2.example.com: A Certificate Authority (CA) replica connected to theserver1.example.comhost. -
replica3.example.com: A replica connected to thecaReplica2.example.comhost.
Prerequisites
-
You have generated a full-server or data-only backup of the IdM server with the
ipa-backuputility. See Creating a backup. -
Your backup files are not in the
/tmpor/var/tmpdirectories. - Before performing a full-server restore from a full-server backup, uninstall IdM from the server and reinstall IdM using the same server configuration as before.
Procedure
Use the
ipa-restoreutility to restore a full-server or data-only backup.If the backup directory is in the default
/var/lib/ipa/backup/location, enter only the name of the directory:[root@server1 ~]# ipa-restore ipa-full-2020-01-14-12-02-32If the backup directory is not in the default location, enter its full path:
[root@server1 ~]# ipa-restore /mybackups/ipa-data-2020-02-01-05-30-00NoteThe
ipa-restoreutility automatically detects the type of backup that the directory contains, and performs the same type of restore by default. To perform a data-only restore from a full-server backup, add the--dataoption to theipa-restorecommand:[root@server1 ~]# ipa-restore --data ipa-full-2020-01-14-12-02-32
Enter the Directory Manager password.
Directory Manager (existing master) password:Enter
yesto confirm overwriting current data with the backup.Preparing restore from /var/lib/ipa/backup/ipa-full-2020-01-14-12-02-32 on server1.example.com Performing FULL restore from FULL backup Temporary setting umask to 022 Restoring data will overwrite existing live data. Continue to restore? [no]: yesThe
ipa-restoreutility disables replication on all servers that are available:Each master will individually need to be re-initialized or re-created from this one. The replication agreements on masters running IPA 3.1 or earlier will need to be manually re-enabled. See the man page for details. Disabling all replication. Disabling replication agreement on server1.example.com to caReplica2.example.com Disabling CA replication agreement on server1.example.com to caReplica2.example.com Disabling replication agreement on caReplica2.example.com to server1.example.com Disabling replication agreement on caReplica2.example.com to replica3.example.com Disabling CA replication agreement on caReplica2.example.com to server1.example.com Disabling replication agreement on replica3.example.com to caReplica2.example.comThe utility then stops IdM services, restores the backup, and restarts the services:
Stopping IPA services Systemwide CA database updated. Restoring files Systemwide CA database updated. Restoring from userRoot in EXAMPLE-COM Restoring from ipaca in EXAMPLE-COM Restarting GSS-proxy Starting IPA services Restarting SSSD Restarting oddjobd Restoring umask to 18 The ipa-restore command was successfulRe-initialize all replicas connected to the restored server:
List all replication topology segments for the
domainsuffix, taking note of topology segments involving the restored server.[root@server1 ~]# ipa topologysegment-find domain------------------ 2 segments matched ------------------ Segment name: server1.example.com-to-caReplica2.example.com Left node: server1.example.com Right node: caReplica2.example.com Connectivity: both Segment name: caReplica2.example.com-to-replica3.example.com Left node: caReplica2.example.com Right node: replica3.example.com Connectivity: both ---------------------------- Number of entries returned 2 ----------------------------Re-initialize the
domainsuffix for all topology segments with the restored server.In this example, perform a re-initialization of
caReplica2with data fromserver1.[root@caReplica2 ~]# ipa-replica-manage re-initialize --from=server1.example.comUpdate in progress, 2 seconds elapsed Update succeededMoving on to Certificate Authority data, list all replication topology segments for the
casuffix.[root@server1 ~]# ipa topologysegment-find ca----------------- 1 segment matched ----------------- Segment name: server1.example.com-to-caReplica2.example.com Left node: server1.example.com Right node: caReplica2.example.com Connectivity: both ---------------------------- Number of entries returned 1 ----------------------------Re-initialize all CA replicas connected to the restored server.
In this example, perform a
csreplicare-initialization ofcaReplica2with data fromserver1.[root@caReplica2 ~]# ipa-csreplica-manage re-initialize --from=server1.example.com
Enter the Directory Manager password.
Directory Manager password:Update in progress, 3 seconds elapsed Update succeededContinue moving outward through the replication topology, re-initializing successive replicas, until all servers have been updated with the data from restored server
server1.example.com.In this example, we only have to re-initialize the
domainsuffix onreplica3with the data fromcaReplica2:[root@replica3 ~]# ipa-replica-manage re-initialize --from=caReplica2.example.comEnter the Directory Manager password.
Directory Manager password:Update in progress, 3 seconds elapsed Update succeededClear SSSD’s cache on every server to avoid authentication problems due to invalid data:
Stop the SSSD service:
[root@server ~]# systemctl stop sssdRemove all cached content from SSSD:
[root@server ~]# sss_cache -EStart the SSSD service:
[root@server ~]# systemctl start sssd- Reboot the server.
5.2. Restoring from an encrypted backup Copiar enlaceEnlace copiado en el portapapeles!
You can restore an IdM server from an encrypted IdM backup. The ipa-restore utility automatically detects if an IdM backup is encrypted and restores it using the GPG2 root keyring.
Prerequisites
- A GPG-encrypted IdM backup. See Creating a GPG2-encrypted IdM backup.
- The LDAP Directory Manager password
- The passphrase used when creating the GPG key
Procedure
If you used a custom keyring location when creating the GPG2 keys, verify that the
$GNUPGHOMEenvironment variable is set to that directory. See Creating a GPG2 key.[root@server ~]# echo $GNUPGHOME/root/backupProvide the
ipa-restoreutility with the backup directory location.[root@server ~]# ipa-restore ipa-full-2020-01-13-18-30-54Enter the Directory Manager password.
Directory Manager (existing master) password:Enter the passphrase you used when creating the GPG key.
┌────────────────────────────────────────────────────────────────┐ │ Please enter the passphrase to unlock the OpenPGP secret key: │ │ "GPG User (first key) <root@example.com>" │ │ 2048-bit RSA key, ID BF28FFA302EF4557, │ │ created 2020-01-13. │ │ │ │ │ │ Passphrase: <passphrase> │ │ │ │ <OK> <Cancel> │ └────────────────────────────────────────────────────────────────┘
- Re-initialize all replicas connected to the restored server. See Restoring an IdM server from backup.