
Recovery process is supposed to be performed on the same host the backup was
created on on the same distribution and version. 

If you planning to *migrate* Foreman instance, please read remarks in the
beginning of this chapter. 

Note: Foreman instance must be stopped before proceeding. 

#### PostgreSQL, MySQL, SQLite

Run ```foreman-rake db:import_dump file=/your/db/dump/location```.  This will load your
dump into the current database for your environment.  It will print a message
to notify you when it has finished importing the dump. 

Remember to stop the Foreman instance and any other process consuming data from the
database temporarily during the import and turn it back on after it ends. 

### Configuration

On Red Hat compatible systems issue the following command to restore whole /etc
directory structure:

    tar --selinux -xzvf etc_foreman_dir.tar.gz -C /

For all other distribution do similar command:

    tar -xzvf etc_foreman_dir.tar.gz -C /

It is recommended to extract files to an empty directory first and inspect the
content before overwriting current files (change -C option to an empty
directory). 

### Puppet master

On the puppet master node, issue the following command to restore Puppet
certificates on Red Hat compatible systems

    tar --selinux -xzvf var_lib_puppet_dir.tar.gz -C /

For all other distribution do similar command:

    tar -xzvf var_lib_puppet_dir.tar.gz -C /

It is recommended to inspect the content of the restore first (see above). 

### DHCP, DNS and TFTP services

Depending on used software packages, perform recovery of important data and
configuration files according to the documentation.  This depends on the
software and distribution that is in use.