I had Postgresql version 11 on my macOS Catalina. Recently I have upgraded my macOS from Catalina to Big Sur. After upgrading I was trying to start Postgresql with
pg_ctl but it was showing version conflict
The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 12.4. After searching a few pages I was trying to update my Postgresql by
brew postgresql-upgrade-database. In the meantime, my internet was interrupted and the upgrade process stopped during pouring
Upgrading postgis 3.0.2 -> 3.0.3. After a long hour, I manually stopped the Upgradation and tried to run again the Upgradation. It was showing a large list of error and warnings which I am giving in the last section of this question
Then I tried to reinstall postgresql@11 and postgresql manually. it was installed but not starting. The pg_ctl version is showing 13.1.
brew search postgresql showing postgresql and postgresql@11 is installed. But cannot start anyone of my postgresql server. Now I see in
/usr/local/var/postgres directory only one folder remained named
postgres.old and when I am trying to start the postgresql@11 or postgresql with
pg_ctl -D /usr/local/var/postgres start then it is returning
pg_ctl: directory "/usr/local/var/postgres" is not a database cluster directory.
Is there any way to retrieve my data back with a working version of PostgreSQL?
Error and warnings during
Error: Service `postgresql` is not started. waiting for server to start....2020-11-25 17:47:07.285 +06 (14418) LOG: listening on IPv6 address "::1", port 5432 2020-11-25 17:47:07.285 +06 (14418) LOG: listening on IPv4 address "127.0.0.1", port 5432 2020-11-25 17:47:07.286 +06 (14418) LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2020-11-25 17:47:07.315 +06 (14419) LOG: database system was shut down at 2020-09-23 02:07:05 +06 2020-11-25 17:47:07.322 +06 (14418) LOG: database system is ready to accept connections done server started waiting for server to shut down...2020-11-25 17:47:07.978 +06 (14418) LOG: received fast shutdown request .2020-11-25 17:47:07.979 +06 (14418) LOG: aborting any active transactions 2020-11-25 17:47:07.980 +06 (14418) LOG: background worker "logical replication launcher" (PID 14425) exited with exit code 1 2020-11-25 17:47:07.980 +06 (14420) LOG: shutting down 2020-11-25 17:47:07.986 +06 (14418) LOG: database system is shut down done server stopped ==> Moving postgresql data from /usr/local/var/postgres to /usr/local/var/postgres.old... ==> Creating database... The files belonging to this database system will be owned by user "azizul.admin". This user must also own the server process. The database cluster will be initialized with locales COLLATE: C CTYPE: UTF-8 MESSAGES: C MONETARY: C NUMERIC: C TIME: C initdb: could not find suitable text search configuration for locale "UTF-8" The default text search configuration will be set to "simple". Data page checksums are disabled. fixing permissions on existing directory /usr/local/var/postgres ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Dhaka creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: /usr/local/opt/postgresql/bin/pg_ctl -D /usr/local/var/postgres -l logfile start ==> Migrating and upgrading data... 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 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 Creating dump of global objects ok Creating dump of database schemas template1 *failure* *failure* Consult the last few lines of "pg_upgrade_dump_683211.log" for the probable cause of the failure. Failure, exiting Consult the last few lines of "pg_upgrade_dump_66436.log" for the probable cause of the failure. Failure, exiting *failure* Consult the last few lines of "pg_upgrade_dump_642851.log" for the probable cause of the failure. Failure, exiting *failure* Consult the last few lines of "pg_upgrade_dump_48901.log" for the probable cause of the failure. Failure, exiting *failure* *failure* Consult the last few lines of "pg_upgrade_dump_16384.log" for the probable cause of the failure. Failure, exiting Consult the last few lines of "pg_upgrade_dump_18240.log" for the probable cause of the failure. Failure, exiting *failure* Consult the last few lines of "pg_upgrade_dump_13364.log" for the probable cause of the failure. Failure, exiting child process exited abnormally: status 256 Failure, exiting Error: Upgrading postgresql data from 11 to 13 failed! ==> Removing empty postgresql initdb database... ==> Moving postgresql data back from /usr/local/var/postgres.old to /usr/local/var/postgre Could not enable service: 125: Domain does not support specified action Error: Failure while executing; `/bin/launchctl enable gui/503/homebrew.mxcl.postgresql` exited with 125. Error: Failure while executing; `/usr/local/opt/postgresql/bin/pg_upgrade -r -b /usr/local/Cellar/postgresql@11/11.10/bin -B /usr/local/opt/postgresql/bin -d /usr/local/var/postgres.old -D /usr/local/var/postgres -j 12` exited with 1.