Description of problem: Unable to restore from 3.1 LogCollector DB backup file backup files created with LogCollector on 3.1 will fail to restore. This is due to the fact that LogCollector is using PG pg_dump utility with the TAR format in order to backup the database. Unfortunately, there is a bug (Tom Lane claims that this is a feature,) that in case that TAR format is used the -c flag of pg_dump is not honoured and will create always DROP statements for all database objects in the generated restore.sql script. (See http://www.postgresql.org/message-id/E1TrqX7-0002qd-4e@wrigleys.postgresql.org) The DROP statements caused DB errors when attempting to restore the backup by 1) dropping existing DB 2) re creating a new blank db with teh same name 3) using pg_restore to restore database from the backup file Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1.create a database backup from LogCollector on 3.1 or use and existing one or use pg_dump with -F t flag to generate this file 2.drop the database using dropdb 3.recreate the database using createdb 4.try to use pg_restore to restore the database from the file in 1) Actual results: Lots of errors on the DROP statements Expected results: We should be able to restore the database from the LogCollector DB backup file Additional info: The only way to resolve that is to create a utility that will 1) Open the backup TAR file to a directory D 2) Do sed operations on the restore.sql to remove unneeded statements After that, the database should be restored with: psql -U engine -f <D>/restore.sql engine where <D> is the directory to which the TAR was extracted in 1)
Verified on is5:
Created attachment 773571 [details] Restore output
Checked on is5, Back to assign: In case that engine is the only database installed, the language plpgsql is removed with the database, and not installed again, by the restore script. This fail the restore, and also require to run engine-cleanup\engine-setup in order to connect to the rhevm via GUI.
fixed in commit: e5acad1
everything seems to be fine, use this steps: [root@dk-rh33 ~]# service ovirt-engine stop [root@dk-rh33 ~]# pg_dump -F t -U postgres engine >backup.tar [root@dk-rh33 ~]# dropdb -U postgres engine [root@dk-rh33 ~]# createdb -U postgres engine [root@dk-rh33 ~]# pg_restore -d engine -U postgres backup.tar [root@dk-rh33 ~]# service ovirt-engine start database was restored correctly, althoug it gave me this warnings : pg_restore: WARNING: column "storage_pool_id" has type "unknown" DETAIL: Proceeding with relation creation anyway. pg_restore: WARNING: column "storage_pool_name" has type "unknown" DETAIL: Proceeding with relation creation anyway. setting as verified
Closing - RHEV 3.3 Released