<div dir="ltr"><div><div><div><div><div><div><div><div>oVirt version = 3.6.5 on CentOS 7.2<br><br></div>I have Data Warehouse and Reports database<br><br></div>Method 1:<br><br></div>In the Manager machine:<br><br>engine-backup --mode=backup --file=/home/cnscadmin/engine-3.6.bck --log=/home/cnscadmin/backup.log<br><br></div>less /home/cnscadmin/backup.log<br><br>2016-05-23 11:43:30 3585: Start of engine-backup mode backup scope all file /home/cnscadmin/engine-3.6.bck<br>2016-05-23 11:43:30 3585: OUTPUT: Backing up:<br>2016-05-23 11:43:30 3585: Generating pgpass<br>2016-05-23 11:43:30 3585: OUTPUT: Notifying engine<br>2016-05-23 11:43:30 3585: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;files&#39;, now(), 0, &#39;Started&#39;, &#39;<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br> <br><br>2016-05-23 11:43:30 3585: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;db&#39;, now(), 0, &#39;Started&#39;, &#39;<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br> <br><br>2016-05-23 11:43:30 3585: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;dwhdb&#39;, now(), 0, &#39;Started&#39;, &#39;<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br> <br><br>2016-05-23 11:43:30 3585: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;reportsdb&#39;, now(), 0, &#39;Started&#39;, &#39;<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br> <br><br>2016-05-23 11:43:30 3585: Creating temp folder /tmp/engine-backup.UwsBOUPMGT/tar<br>2016-05-23 11:43:30 3585: OUTPUT: - Files<br>2016-05-23 11:43:30 3585: Backing up files to /tmp/engine-backup.UwsBOUPMGT/tar/files<br>2016-05-23 11:43:30 3585: OUTPUT: - Engine database &#39;engine&#39;<br>2016-05-23 11:43:30 3585: Backing up database to /tmp/engine-backup.UwsBOUPMGT/tar/db/engine_backup.db<br>2016-05-23 11:43:30 3585: pg_cmd running: pg_dump -w -U engine -h localhost -p 5432  engine -E UTF8 --disable-dollar-quoting --disable-triggers --format=custom<br>2016-05-23 11:43:31 3585: OUTPUT: - DWH database &#39;ovirt_engine_history&#39;<br>2016-05-23 11:43:31 3585: Backing up dwh database to /tmp/engine-backup.UwsBOUPMGT/tar/db/dwh_backup.db<br>2016-05-23 11:43:31 3585: pg_cmd running: pg_dump -w -U ovirt_engine_history -h localhost -p 5432  ovirt_engine_history -E UTF8 --disable-dollar-quoting --disable-triggers --format=custom<br>2016-05-23 11:43:32 3585: OUTPUT: - Reports database &#39;ovirt_engine_reports&#39;<br>2016-05-23 11:43:32 3585: Backing up reports database to /tmp/engine-backup.UwsBOUPMGT/tar/db/reports_backup.db<br>2016-05-23 11:43:32 3585: pg_cmd running: pg_dump -w -U ovirt_engine_reports -h localhost -p 5432  ovirt_engine_reports -E UTF8 --disable-dollar-quoting --disable-triggers --format=custom<br>2016-05-23 11:43:33 3585: Creating md5sum at /tmp/engine-backup.UwsBOUPMGT/tar/md5sum<br>2016-05-23 11:43:33 3585: OUTPUT: Packing into file &#39;/home/cnscadmin/engine-3.6.bck&#39;<br>2016-05-23 11:43:33 3585: Creating tarball /home/cnscadmin/engine-3.6.bck<br>2016-05-23 11:43:33 3585: OUTPUT: Notifying engine<br>2016-05-23 11:43:33 3585: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;files&#39;, now(), 1, &#39;Finished&#39;, &#39;<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br> <br><br>2016-05-23 11:43:33 3585: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;db&#39;, now(), 1, &#39;Finished&#39;, &#39;<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br> <br><br>2016-05-23 11:43:33 3585: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;dwhdb&#39;, now(), 1, &#39;Finished&#39;, &#39;<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br> <br><br>2016-05-23 11:43:33 3585: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;reportsdb&#39;, now(), 1, &#39;Finished&#39;, &#39;<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br> <br><br>2016-05-23 11:43:33 3585: OUTPUT: Done.<br><br></div>In the Restore Machine:<br><br>yum -y install postgresql postgresql-server postgresql-contrib<br><pre>postgresql-setup initdb

systemctl enable postgresql.service

systemctl start postgresql.service<br><br></pre><pre>less /var/lib/pgsql/data/pg_hba.conf</pre><pre><br>host    engine          engine          <a href="http://0.0.0.0/0">0.0.0.0/0</a>               md5<br>host    ovirt_engine_reports          ovirt_engine_reports          <a href="http://0.0.0.0/0">0.0.0.0/0</a>               md5<br>host    ovirt_engine_history          ovirt_engine_history          <a href="http://0.0.0.0/0">0.0.0.0/0</a>               md5<br><br><br>host    engine          engine          ::0/0                   md5<br>host    ovirt_engine_reports          ovirt_engine_reports          ::0/0                   md5<br>host    ovirt_engine_history          ovirt_engine_history          ::0/0                   md5<br><br></pre><pre>less /var/lib/pgsql/data/postgresql.conf<br><br>listen_addresses = &#39;*&#39;                  # what IP address(es) to listen on;<br></pre><pre><br>firewall-cmd --permanent --add-service=postgresql<br><br>firewall-cmd --reload <br></pre>engine-backup --mode=restore --file=/home/cnscadmin/engine-3.6.bck --log=/home/cnscadmin/restore.log --provision-db --no-restore-permissions<br><br></div>less /home/cnscadmin/restore.log<br><br>2016-05-23 11:49:08 2970: Start of engine-backup mode restore scope all file /home/cnscadmin/engine-3.6.bck<br>2016-05-23 11:49:08 2970: OUTPUT: Preparing to restore:<br>2016-05-23 11:49:08 2970: OUTPUT: - Unpacking file &#39;/home/cnscadmin/engine-3.6.bck&#39;<br>2016-05-23 11:49:08 2970: Opening tarball /home/cnscadmin/engine-3.6.bck to /tmp/engine-backup.gUyOwLF4yI<br>2016-05-23 11:49:08 2970: Verifying md5<br>2016-05-23 11:49:08 2970: Verifying version<br>2016-05-23 11:49:08 2970: Reading config<br>2016-05-23 11:49:08 2970: OUTPUT: Restoring:<br>2016-05-23 11:49:08 2970: OUTPUT: - Files<br>2016-05-23 11:49:08 2970: Restoring files<br>2016-05-23 11:49:08 2970: Reloading configuration<br>2016-05-23 11:49:08 2970: OUTPUT: Provisioning PostgreSQL users/databases:<br>2016-05-23 11:49:08 2970: provisionDB: user engine host localhost port 5432 database engine secured False secured_host_validation False<br>2016-05-23 11:49:08 2970: OUTPUT: - user &#39;engine&#39;, database &#39;engine&#39;<br>[ INFO  ] Stage: Initializing<br>[ INFO  ] Stage: Environment setup<br>          Configuration files: [&#39;/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf&#39;, &#39;/etc/ovirt-engine-setup.conf.d/10-packaging-reports-jboss.conf&#39;, &#39;/etc/ovirt-engine-setup.conf.d/10-packaging.conf&#39;, &#39;/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf&#39;, &#39;/tmp/engine-backup.gUyOwLF4yI/pg-provision-answer-file&#39;]<br>          Log file: /var/log/ovirt-engine/setup/ovirt-engine-provisiondb-20160523114908-ane5uv.log<br>          Version: otopi-1.4.1 (otopi-1.4.1-1.el7.centos)<br>[ INFO  ] Stage: Environment packages setup<br>[ INFO  ] Stage: Programs detection<br>[ INFO  ] Stage: Environment customization<br>[ INFO  ] Stage: Setup validation<br>[ INFO  ] Stage: Transaction setup<br>[ INFO  ] Stage: Misc configuration<br>[ INFO  ] Stage: Package installation<br>[ INFO  ] Stage: Misc configuration<br>[ INFO  ] Creating PostgreSQL &#39;engine&#39; database<br>[ INFO  ] Configuring PostgreSQL<br>[ INFO  ] Stage: Transaction commit<br>[ INFO  ] Stage: Closing up<br>[ INFO  ] Stage: Clean up<br>          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-provisiondb-20160523114908-ane5uv.log<br>[ INFO  ] Stage: Pre-termination<br>[ INFO  ] Stage: Termination<br>[ INFO  ] Execution of provisiondb completed successfully<br>2016-05-23 11:49:12 2970: OUTPUT: Restoring:<br>2016-05-23 11:49:12 2970: Generating pgpass<br>2016-05-23 11:49:12 2970: Verifying connection<br>2016-05-23 11:49:12 2970: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -c select 1<br> ?column?<br>----------<br>        1<br>(1 row)<br><br>2016-05-23 11:49:12 2970: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -t -c show lc_messages<br>2016-05-23 11:49:12 2970: pg_cmd running: pg_dump -w -U engine -h localhost -p 5432  engine -s<br>2016-05-23 11:49:12 2970: pg_cmd running: psql -w -U ovirt_engine_history -h localhost -p 5432  ovirt_engine_history -c select 1<br>psql: FATAL:  Ident authentication failed for user &quot;ovirt_engine_history&quot;<br>2016-05-23 11:49:12 2970: FATAL: Can&#39;t connect to database &#39;ovirt_engine_history&#39;. Please see &#39;/bin/engine-backup --help&#39;.<br><br></div>Method 2:<br><br>In the Manager machine:<br><br>engine-backup --mode=backup --scope=all --file=/home/cnscadmin/engine-3.6.tar.bz2 --log=/home/cnscadmin/backup.log<br><br></div>In The Restore Machine<br><br>engine-backup --mode=restore --file=/home/cnscadmin/engine-3.6.tar.bz2 --log=/home/cnscadmin/restore.log --change-db-credentials --db-host=192.168.x.y --db-name=engine --db-user=engine --db-password=MyPassword<br><br><div>Output:<br><br>Preparing to restore:<br>- Setting credentials for Engine database &#39;engine&#39;<br>FATAL: Can&#39;t connect to database &#39;engine&#39;. Please see &#39;/bin/engine-backup --help&#39;.<br><br>less /home/cnscadmin/restore.log :<br><br>2016-05-23 13:47:36 2973: Start of engine-backup mode restore scope all file /home/cnscadmin/engine-3.6.tar.bz2<br>2016-05-23 13:47:36 2973: OUTPUT: Preparing to restore:<br>2016-05-23 13:47:36 2973: OUTPUT: - Setting credentials for Engine database &#39;engine&#39;<br>2016-05-23 13:47:36 2973: pg_cmd running: psql -w -U engine -h 192.168.x.y -p 5432  engine -c select 1<br>psql: FATAL:  password authentication failed for user &quot;engine&quot;<br>password retrieved from file &quot;/tmp/engine-backup.dWpTSHqQxq/.pgpass&quot;<br>2016-05-23 13:47:36 2973: FATAL: Can&#39;t connect to database &#39;engine&#39;. Please see &#39;/bin/engine-backup --help&#39;.<br><br><br><br></div></div>