Switching from PostgreSQL 12 to PostgreSQL 13 using the dhis2-tools-ng gave a database connection error

I was trying to use the new PostgreSQL 13 on my dhis2 installation using the dhis2-tools-ng but now I am getting database connection error. I already verified which port the database is running and it is running on 5432 but yet still I am having connection issue.
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0* LISTEN 208/systemd-resolve
tcp 0 0* LISTEN 251/sshd: /usr/sbin
tcp 0 0* LISTEN 292/postgres
tcp6 0 0 :::4949 :::* LISTEN 278/perl
tcp6 0 0 :::22 :::* LISTEN 251/sshd: /usr/sbin