<div dir="ltr"><div><div>Thanks (SOLVED)<br><br></div>You nailed it<br><br></div>But I don&#39;t see the &quot;--provision-dwh-db --provision-reports-db&quot;  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">&lt;<a href="mailto:didi@redhat.com" target="_blank">didi@redhat.com</a>&gt;</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 &lt;<a href="mailto:danteconrad14@gmail.com">danteconrad14@gmail.com</a>&gt; wrote:<br>
&gt; oVirt version = 3.6.5 on CentOS 7.2<br>
&gt;<br>
&gt; I have Data Warehouse and Reports database<br>
&gt;<br>
&gt; Method 1:<br>
&gt;<br>
&gt; In the Manager machine:<br>
&gt;<br>
&gt; engine-backup --mode=backup --file=/home/cnscadmin/engine-3.6.bck<br>
&gt; --log=/home/cnscadmin/backup.log<br>
&gt;<br>
&gt; less /home/cnscadmin/backup.log<br>
&gt;<br>
&gt; 2016-05-23 11:43:30 3585: Start of engine-backup mode backup scope all file<br>
&gt; /home/cnscadmin/engine-3.6.bck<br>
&gt; 2016-05-23 11:43:30 3585: OUTPUT: Backing up:<br>
&gt; 2016-05-23 11:43:30 3585: Generating pgpass<br>
&gt; 2016-05-23 11:43:30 3585: OUTPUT: Notifying engine<br>
&gt; 2016-05-23 11:43:30 3585: pg_cmd running: psql -w -U engine -h localhost -p<br>
&gt; 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;files&#39;, now(), 0, &#39;Started&#39;,<br>
&gt; &#39;<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br>
&gt;<br>
&gt;<br>
&gt; 2016-05-23 11:43:30 3585: pg_cmd running: psql -w -U engine -h localhost -p<br>
&gt; 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;db&#39;, now(), 0, &#39;Started&#39;,<br>
&gt; &#39;<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br>
&gt;<br>
&gt;<br>
&gt; 2016-05-23 11:43:30 3585: pg_cmd running: psql -w -U engine -h localhost -p<br>
&gt; 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;dwhdb&#39;, now(), 0, &#39;Started&#39;,<br>
&gt; &#39;<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br>
&gt;<br>
&gt;<br>
&gt; 2016-05-23 11:43:30 3585: pg_cmd running: psql -w -U engine -h localhost -p<br>
&gt; 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;reportsdb&#39;, now(), 0,<br>
&gt; &#39;Started&#39;, &#39;<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br>
&gt;<br>
&gt;<br>
&gt; 2016-05-23 11:43:30 3585: Creating temp folder<br>
&gt; /tmp/engine-backup.UwsBOUPMGT/tar<br>
&gt; 2016-05-23 11:43:30 3585: OUTPUT: - Files<br>
&gt; 2016-05-23 11:43:30 3585: Backing up files to<br>
&gt; /tmp/engine-backup.UwsBOUPMGT/tar/files<br>
&gt; 2016-05-23 11:43:30 3585: OUTPUT: - Engine database &#39;engine&#39;<br>
&gt; 2016-05-23 11:43:30 3585: Backing up database to<br>
&gt; /tmp/engine-backup.UwsBOUPMGT/tar/db/engine_backup.db<br>
&gt; 2016-05-23 11:43:30 3585: pg_cmd running: pg_dump -w -U engine -h localhost<br>
&gt; -p 5432  engine -E UTF8 --disable-dollar-quoting --disable-triggers<br>
&gt; --format=custom<br>
&gt; 2016-05-23 11:43:31 3585: OUTPUT: - DWH database &#39;ovirt_engine_history&#39;<br>
&gt; 2016-05-23 11:43:31 3585: Backing up dwh database to<br>
&gt; /tmp/engine-backup.UwsBOUPMGT/tar/db/dwh_backup.db<br>
&gt; 2016-05-23 11:43:31 3585: pg_cmd running: pg_dump -w -U ovirt_engine_history<br>
&gt; -h localhost -p 5432  ovirt_engine_history -E UTF8 --disable-dollar-quoting<br>
&gt; --disable-triggers --format=custom<br>
&gt; 2016-05-23 11:43:32 3585: OUTPUT: - Reports database &#39;ovirt_engine_reports&#39;<br>
&gt; 2016-05-23 11:43:32 3585: Backing up reports database to<br>
&gt; /tmp/engine-backup.UwsBOUPMGT/tar/db/reports_backup.db<br>
&gt; 2016-05-23 11:43:32 3585: pg_cmd running: pg_dump -w -U ovirt_engine_reports<br>
&gt; -h localhost -p 5432  ovirt_engine_reports -E UTF8 --disable-dollar-quoting<br>
&gt; --disable-triggers --format=custom<br>
&gt; 2016-05-23 11:43:33 3585: Creating md5sum at<br>
&gt; /tmp/engine-backup.UwsBOUPMGT/tar/md5sum<br>
&gt; 2016-05-23 11:43:33 3585: OUTPUT: Packing into file<br>
&gt; &#39;/home/cnscadmin/engine-3.6.bck&#39;<br>
&gt; 2016-05-23 11:43:33 3585: Creating tarball /home/cnscadmin/engine-3.6.bck<br>
&gt; 2016-05-23 11:43:33 3585: OUTPUT: Notifying engine<br>
&gt; 2016-05-23 11:43:33 3585: pg_cmd running: psql -w -U engine -h localhost -p<br>
&gt; 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;files&#39;, now(), 1,<br>
&gt; &#39;Finished&#39;, &#39;<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br>
&gt;<br>
&gt;<br>
&gt; 2016-05-23 11:43:33 3585: pg_cmd running: psql -w -U engine -h localhost -p<br>
&gt; 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;db&#39;, now(), 1, &#39;Finished&#39;,<br>
&gt; &#39;<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br>
&gt;<br>
&gt;<br>
&gt; 2016-05-23 11:43:33 3585: pg_cmd running: psql -w -U engine -h localhost -p<br>
&gt; 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;dwhdb&#39;, now(), 1,<br>
&gt; &#39;Finished&#39;, &#39;<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br>
&gt;<br>
&gt;<br>
&gt; 2016-05-23 11:43:33 3585: pg_cmd running: psql -w -U engine -h localhost -p<br>
&gt; 5432  engine -t -c SELECT LogEngineBackupEvent(&#39;reportsdb&#39;, now(), 1,<br>
&gt; &#39;Finished&#39;, &#39;<a href="http://ovirt1.cnsc.net" rel="noreferrer" target="_blank">ovirt1.cnsc.net</a>&#39;, &#39;/home/cnscadmin/backup.log&#39;);<br>
&gt;<br>
&gt;<br>
&gt; 2016-05-23 11:43:33 3585: OUTPUT: Done.<br>
&gt;<br>
&gt; In the Restore Machine:<br>
&gt;<br>
&gt; yum -y install postgresql postgresql-server postgresql-contrib<br>
&gt;<br>
&gt; postgresql-setup initdb<br>
&gt;<br>
&gt; systemctl enable postgresql.service<br>
&gt;<br>
&gt; systemctl start postgresql.service<br>
&gt;<br>
&gt; less /var/lib/pgsql/data/pg_hba.conf<br>
&gt;<br>
&gt;<br>
&gt; host    engine          engine          <a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">0.0.0.0/0</a>               md5<br>
&gt; host    ovirt_engine_reports          ovirt_engine_reports<br>
&gt; <a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">0.0.0.0/0</a>               md5<br>
&gt; host    ovirt_engine_history          ovirt_engine_history<br>
&gt; <a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">0.0.0.0/0</a>               md5<br>
&gt;<br>
&gt;<br>
&gt; host    engine          engine          ::0/0                   md5<br>
&gt; host    ovirt_engine_reports          ovirt_engine_reports          ::0/0<br>
&gt; md5<br>
&gt; host    ovirt_engine_history          ovirt_engine_history          ::0/0<br>
&gt; md5<br>
&gt;<br>
&gt; less /var/lib/pgsql/data/postgresql.conf<br>
&gt;<br>
&gt; listen_addresses = &#39;*&#39;                  # what IP address(es) to listen on;<br>
&gt;<br>
&gt;<br>
&gt; firewall-cmd --permanent --add-service=postgresql<br>
&gt;<br>
&gt; firewall-cmd --reload<br>
&gt;<br>
<br>
</div></div>All of the above is not needed (but should be harmless) if you use<br>
--provision* .<br>
<span class=""><br>
&gt; engine-backup --mode=restore --file=/home/cnscadmin/engine-3.6.bck<br>
&gt; --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>
&gt;<br>
&gt; less /home/cnscadmin/restore.log<br>
&gt;<br>
&gt; 2016-05-23 11:49:08 2970: Start of engine-backup mode restore scope all file<br>
&gt; /home/cnscadmin/engine-3.6.bck<br>
&gt; 2016-05-23 11:49:08 2970: OUTPUT: Preparing to restore:<br>
&gt; 2016-05-23 11:49:08 2970: OUTPUT: - Unpacking file<br>
&gt; &#39;/home/cnscadmin/engine-3.6.bck&#39;<br>
&gt; 2016-05-23 11:49:08 2970: Opening tarball /home/cnscadmin/engine-3.6.bck to<br>
&gt; /tmp/engine-backup.gUyOwLF4yI<br>
&gt; 2016-05-23 11:49:08 2970: Verifying md5<br>
&gt; 2016-05-23 11:49:08 2970: Verifying version<br>
&gt; 2016-05-23 11:49:08 2970: Reading config<br>
&gt; 2016-05-23 11:49:08 2970: OUTPUT: Restoring:<br>
&gt; 2016-05-23 11:49:08 2970: OUTPUT: - Files<br>
&gt; 2016-05-23 11:49:08 2970: Restoring files<br>
&gt; 2016-05-23 11:49:08 2970: Reloading configuration<br>
&gt; 2016-05-23 11:49:08 2970: OUTPUT: Provisioning PostgreSQL users/databases:<br>
&gt; 2016-05-23 11:49:08 2970: provisionDB: user engine host localhost port 5432<br>
&gt; database engine secured False secured_host_validation False<br>
&gt; 2016-05-23 11:49:08 2970: OUTPUT: - user &#39;engine&#39;, database &#39;engine&#39;<br>
&gt; [ INFO  ] Stage: Initializing<br>
&gt; [ INFO  ] Stage: Environment setup<br>
&gt;           Configuration files:<br>
&gt; [&#39;/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf&#39;,<br>
&gt; &#39;/etc/ovirt-engine-setup.conf.d/10-packaging-reports-jboss.conf&#39;,<br>
&gt; &#39;/etc/ovirt-engine-setup.conf.d/10-packaging.conf&#39;,<br>
&gt; &#39;/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf&#39;,<br>
&gt; &#39;/tmp/engine-backup.gUyOwLF4yI/pg-provision-answer-file&#39;]<br>
&gt;           Log file:<br>
&gt; /var/log/ovirt-engine/setup/ovirt-engine-provisiondb-20160523114908-ane5uv.log<br>
&gt;           Version: otopi-1.4.1 (otopi-1.4.1-1.el7.centos)<br>
&gt; [ INFO  ] Stage: Environment packages setup<br>
&gt; [ INFO  ] Stage: Programs detection<br>
&gt; [ INFO  ] Stage: Environment customization<br>
&gt; [ INFO  ] Stage: Setup validation<br>
&gt; [ INFO  ] Stage: Transaction setup<br>
&gt; [ INFO  ] Stage: Misc configuration<br>
&gt; [ INFO  ] Stage: Package installation<br>
&gt; [ INFO  ] Stage: Misc configuration<br>
&gt; [ INFO  ] Creating PostgreSQL &#39;engine&#39; database<br>
&gt; [ INFO  ] Configuring PostgreSQL<br>
&gt; [ INFO  ] Stage: Transaction commit<br>
&gt; [ INFO  ] Stage: Closing up<br>
&gt; [ INFO  ] Stage: Clean up<br>
&gt;           Log file is located at<br>
&gt; /var/log/ovirt-engine/setup/ovirt-engine-provisiondb-20160523114908-ane5uv.log<br>
&gt; [ INFO  ] Stage: Pre-termination<br>
&gt; [ INFO  ] Stage: Termination<br>
&gt; [ INFO  ] Execution of provisiondb completed successfully<br>
&gt; 2016-05-23 11:49:12 2970: OUTPUT: Restoring:<br>
&gt; 2016-05-23 11:49:12 2970: Generating pgpass<br>
&gt; 2016-05-23 11:49:12 2970: Verifying connection<br>
&gt; 2016-05-23 11:49:12 2970: pg_cmd running: psql -w -U engine -h localhost -p<br>
&gt; 5432  engine -c select 1<br>
&gt;  ?column?<br>
&gt; ----------<br>
&gt;         1<br>
&gt; (1 row)<br>
&gt;<br>
&gt; 2016-05-23 11:49:12 2970: pg_cmd running: psql -w -U engine -h localhost -p<br>
&gt; 5432  engine -t -c show lc_messages<br>
&gt; 2016-05-23 11:49:12 2970: pg_cmd running: pg_dump -w -U engine -h localhost<br>
&gt; -p 5432  engine -s<br>
&gt; 2016-05-23 11:49:12 2970: pg_cmd running: psql -w -U ovirt_engine_history -h<br>
&gt; localhost -p 5432  ovirt_engine_history -c select 1<br>
&gt; psql: FATAL:  Ident authentication failed for user &quot;ovirt_engine_history&quot;<br>
&gt; 2016-05-23 11:49:12 2970: FATAL: Can&#39;t connect to database<br>
&gt; &#39;ovirt_engine_history&#39;. Please see &#39;/bin/engine-backup --help&#39;.<br>
&gt;<br>
&gt; Method 2:<br>
&gt;<br>
&gt; In the Manager machine:<br>
&gt;<br>
&gt; engine-backup --mode=backup --scope=all<br>
&gt; --file=/home/cnscadmin/engine-3.6.tar.bz2 --log=/home/cnscadmin/backup.log<br>
&gt;<br>
&gt; In The Restore Machine<br>
&gt;<br>
&gt; engine-backup --mode=restore --file=/home/cnscadmin/engine-3.6.tar.bz2<br>
&gt; --log=/home/cnscadmin/restore.log --change-db-credentials<br>
&gt; --db-host=192.168.x.y --db-name=engine --db-user=engine<br>
&gt; --db-password=MyPassword<br>
&gt;<br>
&gt; Output:<br>
&gt;<br>
&gt; Preparing to restore:<br>
&gt; - Setting credentials for Engine database &#39;engine&#39;<br>
&gt; FATAL: Can&#39;t connect to database &#39;engine&#39;. Please see &#39;/bin/engine-backup<br>
&gt; --help&#39;.<br>
<br>
</div></div>Did you change the password in the db too?<br>
<span class=""><br>
&gt;<br>
&gt; less /home/cnscadmin/restore.log :<br>
&gt;<br>
&gt; 2016-05-23 13:47:36 2973: Start of engine-backup mode restore scope all file<br>
&gt; /home/cnscadmin/engine-3.6.tar.bz2<br>
&gt; 2016-05-23 13:47:36 2973: OUTPUT: Preparing to restore:<br>
&gt; 2016-05-23 13:47:36 2973: OUTPUT: - Setting credentials for Engine database<br>
&gt; &#39;engine&#39;<br>
&gt; 2016-05-23 13:47:36 2973: pg_cmd running: psql -w -U engine -h 192.168.x.y<br>
&gt; -p 5432  engine -c select 1<br>
<br>
</span>Basically, that&#39;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>
&gt; psql: FATAL:  password authentication failed for user &quot;engine&quot;<br>
&gt; password retrieved from file &quot;/tmp/engine-backup.dWpTSHqQxq/.pgpass&quot;<br>
&gt; 2016-05-23 13:47:36 2973: FATAL: Can&#39;t connect to database &#39;engine&#39;. Please<br>
&gt; see &#39;/bin/engine-backup --help&#39;.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</span>&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
&gt; <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
&gt;<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Didi<br>
</font></span></blockquote></div><br></div>