Error: "New cluster database "cemdb" is not empty" when upgrading the Postgresql Database.
search cancel

Error: "New cluster database "cemdb" is not empty" when upgrading the Postgresql Database.

book

Article ID: 261687

calendar_today

Updated On:

Products

DX Application Performance Management

Issue/Introduction

When following the steps from APM 10.x - How to manual upgrade PostgreSQL 9.6.2 to 13.4 and higher versions? to upgrade PostgreSQL the following error is encountered.

When the following command is run:

/usr/pgsql-13/bin/pg_upgrade -b /opt/apm/postgres/PostgreSQL-9.6.2/bin -B /usr/pgsql-13/bin -d /opt/apm/postgres/PostgreSQL-9.6.2/data -D /opt/apm/pgsql/13/data

The error below is received:

Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
Checking database user is the install user                  ok
Checking database connection settings                       ok
Checking for prepared transactions                          ok
Checking for system-defined composite types in user tables  ok
Checking for reg* data types in user tables                 ok
Checking for contrib/isn with bigint-passing mismatch       ok
Checking for tables WITH OIDS                               ok
Checking for invalid "sql_identifier" user columns          ok
Checking for invalid "unknown" user columns                 ok
Creating dump of global objects                             ok
Creating dump of database schemas                           ok

New cluster database "cemdb" is not empty: found relation "public.ts_app_auth_types"
Failure, exiting

Environment

Release : 10.7.0

Resolution

Upgrade Error - New cluster is not empty; exiting

If pg_upgrade reports that the new cluster is not empty, please empty the new cluster. The target cluster may not contain any user-defined databases.

 

Please see the following PostgreSQL community webisite for more information.  pg_upgrade Troubleshooting