# [SOLVED]PostgreSQL Update 12 -> 13 / Convert databases fails



## Tecuma (Dec 15, 2021)

Hello community,

I try to update PostgreSQL from 12 to 13 according to this instruction.

I try to convert the databases with 

```
su -l postgres -c "pg_upgrade -b /tmp/pg-upgrade/usr/local/bin/ -d /var/db/postgres/data12/ -B /usr/local/bin/ -D /var/db/postgres/data13/ -U postgres "
```

I got an error message


```
root@abhean:/var/db/postgres # su -l postgres -c "pg_upgrade -b /tmp/pg-upgrade/usr/local/bin/ -d /var/db/postgres/data12/ -B /usr/local/bin/ -D /var/db/postgres/data13/ -U postgres "
Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok

*failure*
Consult the last few lines of "pg_upgrade_server.log" for
the probable cause of the failure.

connection to database failed: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/db/postgres/.s.PGSQL.50432"?

could not connect to source postmaster started with the command:
"/tmp/pg-upgrade/usr/local/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/db/postgres/data12" -o "-p 50432 -b  -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/var/db/postgres'" start
Failure, exiting
```

When I check the log file I can see


```
-----------------------------------------------------------------
  pg_upgrade run on Wed Dec 15 19:39:07 2021
-----------------------------------------------------------------

command: "/tmp/pg-upgrade/usr/local/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/db/postgres/data12" -o "-p 50432 -b  -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/var/db/postgres'" start >> "pg_upgrade_server.log" 2>&1
ld-elf.so.1: Shared object "libicui18n.so.69" not found, required by "postgres"
no data was returned by command ""/tmp/pg-upgrade/usr/local/bin/postgres" -V"
The program "postgres" is needed by pg_ctl but was not found in the
same directory as "/tmp/pg-upgrade/usr/local/bin/pg_ctl".
Check your installation.
```

From my understanding I need libicui18n.so.69. On my system I have libicui18n.so.70.1. 

I had to made some updates via pkg during my installation try from GitLab. I guess during one of an update I got the new version from libicui18n.

How can I solve this? Is it possible to install multiple versions of libicui18n?

Best regards

--Christian


----------



## SirDice (Dec 15, 2021)

Grab a new version of the old database packages with `pkg fetch postgresql12-server`. Then use that instead of the 'backup' you created with pkg-create(8).

The new version you fetched from the repositories was built against the 'new' libicui18n.so.70.1. Your 'old' package (the ones your created with pkg-create(8)) were linked to the 'old' libicui18n.so.69.


----------



## Tecuma (Dec 17, 2021)

Thank you for this information. I will do it.


----------



## Tecuma (Dec 18, 2021)

It was working 
Many many thanks SirDice


----------

