Bug 1381180

Summary: DB restore fails with EDB
Product: [oVirt] ovirt-engine Reporter: Lucie Leistnerova <lleistne>
Component: Backup-Restore.EngineAssignee: Yedidyah Bar David <didi>
Status: CLOSED WONTFIX QA Contact: Pavel Stehlik <pstehlik>
Severity: high Docs Contact:
Priority: low    
Version: 4.0.5CC: bugs, emesika, mkalinin, ylavi
Target Milestone: ---Flags: sbonazzo: ovirt-4.3-
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-04 19:43:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1324882    
Attachments:
Description Flags
backup.log none

Description Lucie Leistnerova 2016-10-03 10:38:14 UTC
Created attachment 1206800 [details]
backup.log

Description of problem:
engine-setup --mode=restore for remote EDB returns 'FATAL: Errors while restoring database engine', but all tables and views are created and in log are only errors on COMMENT EXTENSION and warnings


Version-Release number of selected component (if applicable):
ovirt-engine-tools-backup-4.0.5-0.1.el7ev.noarch


Steps to Reproduce:
1. have backup of remote EDB and prepared empty engine remote database with created role engine
2. copy pg_dump/pg_restore from EDB to engine and put it in /usr/bin instead of the postgresql ones
3. engine-backup --mode=restore --scope=db --file=/tmp/engine3-edb-201609230935.bck --log=/tmp/backup.log --change-db-credentials --db-host=XX.XX.XX.XX --db-port=XXXX --db-user=engine --db-password=XX --db-name=engine --no-restore-permissions

see log attached

Comment 1 Eli Mesika 2016-11-01 09:38:31 UTC
See http://stackoverflow.com/questions/10169203/postgresql-9-1-pg-restore-error-regarding-plpgsql

Is it possible to add to engine-backup support of the -n option such that we will skip objects that are not on the public schema upon restore ?

Comment 2 Yedidyah Bar David 2016-11-01 09:44:00 UTC
(In reply to Eli Mesika from comment #1)
> See
> http://stackoverflow.com/questions/10169203/postgresql-9-1-pg-restore-error-
> regarding-plpgsql
> 
> Is it possible to add to engine-backup support of the -n option such that we
> will skip objects that are not on the public schema upon restore ?

We already agreed in bug 1378921 to not do this.

We already filter out some of the errors. I suspect that we only need to add there a few lines for edb-specific extensions, but want to make sure first. I am trying to register there to get a free trial, then try this myself.