Migration failure for Postgres Database with a blank space in it

Migration failure for Postgres Database with a blank space in it

Trace : 
  1. \ManageEngine\ServiceDesk\Patch\AdventNet_ManageEngine_ServiceDesk_Plus-14.2.0-SP-1.0.0\SERVICEDESK\PreInstall\pg_migrate\pgsql_old\bin\pg_dumpall.exe", -U, postgres, -p, 65433, -h, 127.0.0.1, -r, -w, |, "D:\ManageEngine\ServiceDesk\pgsql\bin\psql.exe", -U, postgres, -p, 65432, -h, 127.0.0.1, -w, servicedesk new] 
  2. Jul 11, 2023 2:16:28 AM  [com.zoho.postgres.migrate.DumpMigration]  [INFO] : psql: warning: extra command-line argument "new" ignored
  3. Jul 11, 2023 2:16:28 AM  [com.zoho.postgres.migrate.DumpMigration]  [WARNING] : Error :::: psql: FATAL:  database "servicedesk" does not exist

Cause : 
      In the Build version 14300(SDP) and 7000 (AE), PostgreSQL is upgraded to 11.17 from 10.21. During this upgrade, data migration will be taken place. In the process of migrating the data, above command will be executed. since the <database name> has a blank space in between, breaks into two arguments when we execute this in the command prompt. 

Workaround : Rename the database to a name without space.
  1. Shut Down the Application service.
  2. Navigate to <Application_home_directory>\bin directory and execute "startDB.bat or startDB.sh"
  1. Navigate to <Application_home_directory>\pgsql\bin directory and connect as "postgres" user with the below command (Refer this KB) without entering the database name.
For Windows,
  1. psql.exe -U <username> -p <port> -h <server address>
For Linux.
  1. ./psql -U <username> -p <port> -h <server address>
  1. Execute the below command to rename the database,
Do not connect the database that you are going to rename 
  1. ALTER DATABASE "<current database name>" RENAME TO "<database_name_without_space>";
  1. Update the modified name into the application, by executing "changeDBServer.bat or changeDBServer.sh"
  2. Stop the Database server by executing "stopDB.sh or stopDB.bat"
After these steps, invoke the upgrade.

                  New to ADSelfService Plus?

                    • Related Articles

                    • Upgrade failure when migrating privileges for removed functions

                      LOG Trace : 03.08.2023 12:50:36 [com.zoho.postgres.migrate.DumpMigration] [SCHWERWIEGEND] : Problem during upgrade.com.zoho.postgres.exception.MigrationFailureException: Restoration failed for PRE_DATA at ...
                    • Database migration from MySQL to Postgres/MSSQL in SCP 8.1

                      We no longer support the use of MYSQL as database in SupportCenter Plus. Hence, we request our users to migrate to Postgres (which is in-built) or Microsoft SQL. Please follow the below steps to carry out the database migration: 1. Shutdown the ...
                    • solution for postgres 11 upgrade issues

                      When Supportcenter Plus is upgraded to 14300 or later, postgres is also upgraded to 11.17. If you are using bundled postgres, data migration through pgdump and restore mechanism also happens. To ensure efficiency in Postgres 11.17, make sure your ...
                    • SDP MSP solution for postgres 11 upgrade issues

                      When ServiceDesk Plus MSP is upgraded to 14300 or later, postgres is also upgraded to 11.17. If you are using bundled postgres, data migration through pgdump and restore mechanism also happens. To ensure efficiency in Postgres 11.17, make sure your ...
                    • Upgrade Failure due to the presence of CtrlZ Failure

                      This issue (SD-118352) in fixed in version 14710. Post this release, these characters are handled in the migration itself. If you are planning to migrate from version less than 14610 to 14610, then you can directly migrate to 14710, to handle this ...