<div dir="ltr"><div><div>Thanks (SOLVED)<br><br></div>You nailed it<br><br></div>But I don't see the "--provision-dwh-db --provision-reports-db" in<br><br><a href="http://www.ovirt.org/develop/release-management/features/engine/engine-backup/">http://www.ovirt.org/develop/release-management/features/engine/engine-backup/</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-24 1:16 GMT-05:00 Yedidyah Bar David <span dir="ltr"><<a href="mailto:didi@redhat.com" target="_blank">didi@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, May 23, 2016 at 9:48 PM, Julián Tete <<a href="mailto:danteconrad14@gmail.com">danteconrad14@gmail.com</a>> wrote:<br>
> oVirt version = 3.6.5 on CentOS 7.2<br>
><br>
> I have Data Warehouse and Reports database<br>
><br>
> Method 1:<br>
><br>
> In the Manager machine:<br>
><br>
> engine-backup --mode=backup --file=/home/cnscadmin/engine-3.6.bck<br>
> --log=/home/cnscadmin/backup.log<br>
><br>
> less /home/cnscadmin/backup.log<br>
><br>
> 2016-05-23 11:43:30 3585: Start of engine-backup mode backup scope all file<br>
> /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<br>
> 5432 engine -t -c SELECT LogEngineBackupEvent('files', now(), 0, 'Started',<br>
> '<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">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<br>
> 5432 engine -t -c SELECT LogEngineBackupEvent('db', now(), 0, 'Started',<br>
> '<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">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<br>
> 5432 engine -t -c SELECT LogEngineBackupEvent('dwhdb', now(), 0, 'Started',<br>
> '<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">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<br>
> 5432 engine -t -c SELECT LogEngineBackupEvent('reportsdb', now(), 0,<br>
> 'Started', '<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">ovirt1.cnsc.net</a>', '/home/cnscadmin/backup.log');<br>
><br>
><br>
> 2016-05-23 11:43:30 3585: Creating temp folder<br>
> /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<br>
> /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<br>
> /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<br>
> -p 5432 engine -E UTF8 --disable-dollar-quoting --disable-triggers<br>
> --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<br>
> /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<br>
> -h localhost -p 5432 ovirt_engine_history -E UTF8 --disable-dollar-quoting<br>
> --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<br>
> /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<br>
> -h localhost -p 5432 ovirt_engine_reports -E UTF8 --disable-dollar-quoting<br>
> --disable-triggers --format=custom<br>
> 2016-05-23 11:43:33 3585: Creating md5sum at<br>
> /tmp/engine-backup.UwsBOUPMGT/tar/md5sum<br>
> 2016-05-23 11:43:33 3585: OUTPUT: Packing into file<br>
> '/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<br>
> 5432 engine -t -c SELECT LogEngineBackupEvent('files', now(), 1,<br>
> 'Finished', '<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">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<br>
> 5432 engine -t -c SELECT LogEngineBackupEvent('db', now(), 1, 'Finished',<br>
> '<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">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<br>
> 5432 engine -t -c SELECT LogEngineBackupEvent('dwhdb', now(), 1,<br>
> 'Finished', '<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">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<br>
> 5432 engine -t -c SELECT LogEngineBackupEvent('reportsdb', now(), 1,<br>
> 'Finished', '<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">ovirt1.cnsc.net</a>', '/home/cnscadmin/backup.log');<br>
><br>
><br>
> 2016-05-23 11:43:33 3585: OUTPUT: Done.<br>
><br>
> In the Restore Machine:<br>
><br>
> yum -y install postgresql postgresql-server postgresql-contrib<br>
><br>
> postgresql-setup initdb<br>
><br>
> systemctl enable postgresql.service<br>
><br>
> systemctl start postgresql.service<br>
><br>
> less /var/lib/pgsql/data/pg_hba.conf<br>
><br>
><br>
> host engine engine <a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">0.0.0.0/0</a> md5<br>
> host ovirt_engine_reports ovirt_engine_reports<br>
> <a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">0.0.0.0/0</a> md5<br>
> host ovirt_engine_history ovirt_engine_history<br>
> <a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">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<br>
> md5<br>
> host ovirt_engine_history ovirt_engine_history ::0/0<br>
> md5<br>
><br>
> less /var/lib/pgsql/data/postgresql.conf<br>
><br>
> listen_addresses = '*' # what IP address(es) to listen on;<br>
><br>
><br>
> firewall-cmd --permanent --add-service=postgresql<br>
><br>
> firewall-cmd --reload<br>
><br>
<br>
</div></div>All of the above is not needed (but should be harmless) if you use<br>
--provision* .<br>
<span class=""><br>
> engine-backup --mode=restore --file=/home/cnscadmin/engine-3.6.bck<br>
> --log=/home/cnscadmin/restore.log --provision-db --no-restore-permissions<br>
<br>
</span>For dwh and reports, please pass also: --provision-dwh-db --provision-reports-db<br>
<div><div class="h5"><br>
><br>
> less /home/cnscadmin/restore.log<br>
><br>
> 2016-05-23 11:49:08 2970: Start of engine-backup mode restore scope all file<br>
> /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<br>
> '/home/cnscadmin/engine-3.6.bck'<br>
> 2016-05-23 11:49:08 2970: Opening tarball /home/cnscadmin/engine-3.6.bck to<br>
> /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<br>
> 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:<br>
> ['/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf',<br>
> '/etc/ovirt-engine-setup.conf.d/10-packaging-reports-jboss.conf',<br>
> '/etc/ovirt-engine-setup.conf.d/10-packaging.conf',<br>
> '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf',<br>
> '/tmp/engine-backup.gUyOwLF4yI/pg-provision-answer-file']<br>
> Log file:<br>
> /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<br>
> /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<br>
> 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<br>
> 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<br>
> -p 5432 engine -s<br>
> 2016-05-23 11:49:12 2970: pg_cmd running: psql -w -U ovirt_engine_history -h<br>
> 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<br>
> 'ovirt_engine_history'. Please see '/bin/engine-backup --help'.<br>
><br>
> Method 2:<br>
><br>
> In the Manager machine:<br>
><br>
> engine-backup --mode=backup --scope=all<br>
> --file=/home/cnscadmin/engine-3.6.tar.bz2 --log=/home/cnscadmin/backup.log<br>
><br>
> In The Restore Machine<br>
><br>
> engine-backup --mode=restore --file=/home/cnscadmin/engine-3.6.tar.bz2<br>
> --log=/home/cnscadmin/restore.log --change-db-credentials<br>
> --db-host=192.168.x.y --db-name=engine --db-user=engine<br>
> --db-password=MyPassword<br>
><br>
> 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<br>
> --help'.<br>
<br>
</div></div>Did you change the password in the db too?<br>
<span class=""><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<br>
> /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<br>
> 'engine'<br>
> 2016-05-23 13:47:36 2973: pg_cmd running: psql -w -U engine -h 192.168.x.y<br>
> -p 5432 engine -c select 1<br>
<br>
</span>Basically, that's the command you should run to debug. Once you make it<br>
work, pass the password you use as --db-password.<br>
<br>
Of course, --provision-* is easier.<br>
<br>
Best,<br>
<span class=""><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<br>
> see '/bin/engine-backup --help'.<br>
><br>
><br>
><br>
><br>
</span>> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
> <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Didi<br>
</font></span></blockquote></div><br></div>