<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('files', now(), 0, 'Started', '<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>', '/home/cnscadmin/backup.log');<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('db', now(), 0, 'Started', '<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>', '/home/cnscadmin/backup.log');<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('dwhdb', now(), 0, 'Started', '<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>', '/home/cnscadmin/backup.log');<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('reportsdb', now(), 0, 'Started', '<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>', '/home/cnscadmin/backup.log');<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 'engine'<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 'ovirt_engine_history'<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 'ovirt_engine_reports'<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 '/home/cnscadmin/engine-3.6.bck'<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('files', now(), 1, 'Finished', '<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>', '/home/cnscadmin/backup.log');<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('db', now(), 1, 'Finished', '<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>', '/home/cnscadmin/backup.log');<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('dwhdb', now(), 1, 'Finished', '<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>', '/home/cnscadmin/backup.log');<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('reportsdb', now(), 1, 'Finished', '<a href="http://ovirt1.cnsc.net">ovirt1.cnsc.net</a>', '/home/cnscadmin/backup.log');<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 = '*' # 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 '/home/cnscadmin/engine-3.6.bck'<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 'engine', database 'engine'<br>[ INFO ] Stage: Initializing<br>[ INFO ] Stage: Environment setup<br> Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging-reports-jboss.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf', '/tmp/engine-backup.gUyOwLF4yI/pg-provision-answer-file']<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 'engine' 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 "ovirt_engine_history"<br>2016-05-23 11:49:12 2970: FATAL: Can't connect to database 'ovirt_engine_history'. Please see '/bin/engine-backup --help'.<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 'engine'<br>FATAL: Can't connect to database 'engine'. Please see '/bin/engine-backup --help'.<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 'engine'<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 "engine"<br>password retrieved from file "/tmp/engine-backup.dWpTSHqQxq/.pgpass"<br>2016-05-23 13:47:36 2973: FATAL: Can't connect to database 'engine'. Please see '/bin/engine-backup --help'.<br><br><br><br></div></div>