During the Red Hat 3scale API Management 2.X On-premises upgrade, the "Import the database backup" step fails with several "already exists" SQL errors

Solution Verified - Updated -

Issue

When restoring the backup of PostgreSQL, few of errors were observed during restore process:

# zcat zync-database-backup-for-2.5.gz | oc rsh $(oc get pods -l 'deploymentConfig=zync-database' -o json | jq '.items[0].metadata.name' -r) bash -c 'psql -d postgres -f -'
SET
SET
SET
psql:<stdin>:14: ERROR:  role "postgres" already exists

...

psql:<stdin>:1539: ERROR:  constraint "fk_rails_c99dfff855" for relation "services" already exists
psql:<stdin>:1547: ERROR:  constraint "fk_rails_cbcddd5826" for relation "applications" already exists
psql:<stdin>:1555: ERROR:  constraint "fk_rails_cd54ced205" for relation "integrations" already exists
psql:<stdin>:1563: ERROR:  constraint "fk_rails_d329ca1b17" for relation "integrations" already exists
REVOKE
REVOKE
GRANT
GRANT

Environment

  • Red Hat 3scale API Management
    • 2.X On-premises

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content