<html><body><div style="font-family: trebuchet ms,sans-serif; font-size: 12pt; color: #000000"><div>Yes, it happens in a clean machine. I try it twice and restore always fails.</div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>From: </b>"Yedidyah Bar David" &lt;didi@redhat.com&gt;<br><b>To: </b>suporte@logicworks.pt, "Eli Mesika" &lt;emesika@redhat.com&gt;<br><b>Cc: </b>"ovirt users" &lt;users@ovirt.org&gt;<br><b>Sent: </b>Thursday, March 1, 2018 7:28:13 AM<br><b>Subject: </b>Re: [ovirt-users] Backup &amp; Restore<br></div><div><br></div><div data-marker="__QUOTED_TEXT__">On Wed, Feb 28, 2018 at 4:44 PM, &nbsp;&lt;suporte@logicworks.pt&gt; wrote:<br>&gt; If I run<br>&gt;<br>&gt; # engine-backup --mode=restore --file=back_futur --log=log_futur<br>&gt; --provision-db --restore-permissions --provision-dwh-db --log=/root/rest-log<br>&gt;<br>&gt; to create a log, I found these errors:<br>&gt;<br>&gt; 2018-02-28 14:36:31 6339: pg_cmd running: psql -w -U ovirt_engine_history -h<br>&gt; localhost -p 5432 ovirt_engine_history -t -c show lc_messages<br>&gt; 2018-02-28 14:36:31 6339: pg_cmd running: pg_dump -w -U ovirt_engine_history<br>&gt; -h localhost -p 5432 ovirt_engine_history -s<br>&gt; 2018-02-28 14:36:31 6339: OUTPUT: - Engine database 'engine'<br>&gt; 2018-02-28 14:36:31 6339: Restoring engine database backup at<br>&gt; /tmp/engine-backup.VVkcNuYAkV/db/engine_backup.db<br>&gt; 2018-02-28 14:36:31 6339: restoreDB: backupfile<br>&gt; /tmp/engine-backup.VVkcNuYAkV/db/engine_backup.db user engine host localhost<br>&gt; port 5432 database engine orig_user compressor format custom jobsnum 2<br>&gt; 2018-02-28 14:36:31 6339: pg_cmd running: pg_restore -w -U engine -h<br>&gt; localhost -p 5432 -d engine -j 2<br>&gt; /tmp/engine-backup.VVkcNuYAkV/db/engine_backup.db<br>&gt; pg_restore: [archiver (db)] Error while PROCESSING TOC:<br>&gt; pg_restore: [archiver (db)] Error from TOC entry 7314; 0 0 COMMENT EXTENSION<br>&gt; plpgsql<br>&gt; pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of<br>&gt; extension plpgsql<br>&gt; Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';<br>&gt;<br>&gt;<br>&gt;<br>&gt; pg_restore: [archiver (db)] Error from TOC entry 693; 1255 211334 FUNCTION<br>&gt; uuid_generate_v1() engine<br>&gt; pg_restore: [archiver (db)] could not execute query: ERROR: function<br>&gt; "uuid_generate_v1" already exists with same argument types<br><br>This is the error that fails you. I have a pending patch to make this more<br>visible in the log [1], need to find time to verify it...<br><br>Does this happen on a clean machine? Perhaps 'engine-cleanup' after such<br>a failed restore is not enough. Please try reinstalling the OS and trying<br>again.<br><br>If it's not an important machine (test/dev/etc), this will probably be<br>enough, as a faster replacement for a full OS reinstall:<br><br>engine-cleanup<br>systemctl stop postgresql<br>systemctl stop rh-postgresql95-postgresql<br>rm -rf /var/lib/pgsql/data /var/opt/rh/rh-postgresql95/lib/pgsql/data<br><br>Then try restore again.<br><br>[1] https://gerrit.ovirt.org/86395<br><br>&gt; Command was: CREATE FUNCTION uuid_generate_v1() RETURNS uuid<br>&gt; LANGUAGE plpgsql STABLE<br>&gt; AS '<br>&gt; DECLARE<br>&gt; v_val BIGINT;<br>&gt; v_4_1_par...<br>&gt; pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of<br>&gt; function uuid_generate_v1<br>&gt; Command was: ALTER FUNCTION public.uuid_generate_v1() OWNER TO engine;<br><br>Adding also Eli. Eli - perhaps we need to patch engine-backup to ignore<br>also this error? I think the minimal flow to reproduce is:<br><br>engine-setup<br>engine-backup --mode=backup --file=f1 --log=l1<br>engine-cleanup<br>engine-backup --mode=restore --file=f1 --provision-db<br>--provision-dwh-db --log=l2<br><br>Didn't try this myself.<br><br>&gt;<br>&gt;<br>&gt; pg_restore: WARNING: column "user_role_title" has type "unknown"<br>&gt; DETAIL: Proceeding with relation creation anyway.<br>&gt; pg_restore: WARNING: no privileges could be revoked for "public"<br>&gt; pg_restore: WARNING: no privileges could be revoked for "public"<br>&gt; pg_restore: WARNING: no privileges were granted for "public"<br>&gt; pg_restore: WARNING: no privileges were granted for "public"<br>&gt; WARNING: errors ignored on restore: 3<br>&gt; 2018-02-28 14:37:23 6339: FATAL: Errors while restoring database engine<br>&gt;<br>&gt; ________________________________<br>&gt; De: suporte@logicworks.pt<br>&gt; Para: "Yedidyah Bar David" &lt;didi@redhat.com&gt;<br>&gt; Cc: "ovirt users" &lt;users@ovirt.org&gt;<br>&gt; Enviadas: Quarta-feira, 28 De Fevereiro de 2018 12:45:04<br>&gt;<br>&gt; Assunto: Re: [ovirt-users] Backup &amp; Restore<br>&gt;<br>&gt; Still no luck:<br>&gt;<br>&gt; # engine-backup --mode=restore --file=back_futur --log=log_futur<br>&gt; --provision-db --restore-permissions --provision-dwh-db<br>&gt; Preparing to restore:<br>&gt; - Unpacking file 'back_futur'<br>&gt; Restoring:<br>&gt; - Files<br>&gt; Provisioning PostgreSQL users/databases:<br>&gt; - user 'engine', database 'engine'<br>&gt; - user 'ovirt_engine_history', database 'ovirt_engine_history'<br>&gt; Restoring:<br>&gt; - Engine database 'engine'<br>&gt; FATAL: Errors while restoring database engine<br>&gt;<br>&gt; I did a engine-cleanup, try it again but still the same error.<br>&gt;<br>&gt; ________________________________<br>&gt; De: "Yedidyah Bar David" &lt;didi@redhat.com&gt;<br>&gt; Para: suporte@logicworks.pt<br>&gt; Cc: "ovirt users" &lt;users@ovirt.org&gt;<br>&gt; Enviadas: Quarta-feira, 28 De Fevereiro de 2018 12:24:50<br>&gt; Assunto: Re: [ovirt-users] Backup &amp; Restore<br>&gt;<br>&gt; On Wed, Feb 28, 2018 at 2:10 PM, &nbsp;&lt;suporte@logicworks.pt&gt; wrote:<br>&gt;&gt; Hi,<br>&gt;&gt;<br>&gt;&gt; I'm testing backup &amp; restore on Ovirt 4.2.<br>&gt;&gt; I follow this doc<br>&gt;&gt;<br>&gt;&gt; https://www.ovirt.org/documentation/admin-guide/chap-Backups_and_Migration/<br>&gt;&gt; Try to restore to a fresh installation but always get this error message:<br>&gt;&gt;<br>&gt;&gt; restore-permissions<br>&gt;&gt; Preparing to restore:<br>&gt;&gt; - Unpacking file 'back_file'<br>&gt;&gt; Restoring:<br>&gt;&gt; - Files<br>&gt;&gt; Provisioning PostgreSQL users/databases:<br>&gt;&gt; - user 'engine', database 'engine'<br>&gt;&gt; Restoring:<br>&gt;&gt; FATAL: Can't connect to database 'ovirt_engine_history'. Please see<br>&gt;&gt; '/usr/bin/engine-backup --help'.<br>&gt;&gt;<br>&gt;&gt; On the live engine I run # engine-backup --scope=all --mode=backup<br>&gt;&gt; --file=file_name --log=log_file_name<br>&gt;&gt;<br>&gt;&gt; And try to restore on a fresh installation:<br>&gt;&gt; # engine-backup --mode=restore --file=file_name --log=log_file_name<br>&gt;&gt; --provision-db --restore-permissions<br>&gt;&gt;<br>&gt;&gt; Any Idea?<br>&gt;<br>&gt; Please try adding to restore command '--providion-dwh-db'. Thanks.<br>&gt; --<br>&gt; Didi<br>&gt;<br>&gt; _______________________________________________<br>&gt; Users mailing list<br>&gt; Users@ovirt.org<br>&gt; http://lists.ovirt.org/mailman/listinfo/users<br><br><br><br>-- <br>Didi<br></div></div></body></html>