Updating Postgres 10.8 to 11.3

I was installing osm2pgsql with Homebrew, and during the process brew update my Postgres from 10.8 to 11.3. At the end of the process, the upgrade of database failed.

Error: Upgrading postgresql data from 10 to 11 failed!
==> Removing empty postgresql initdb database...
==> Moving postgresql data back from /usr/local/var/postgres.old to /usr/local/v
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)
Error: Failure while executing; `/usr/local/opt/postgresql/bin/pg_upgrade -r -b /usr/local/Cellar/postgresql@10/10.8/bin -B /usr/local/opt/postgresql/bin -d /usr/local/var/postgres.old -D /usr/local/var/postgres -j 12` exited with 1.

I receive this message in the log file:

"pg_dump: [archiver (db)] query failed: ERROR: could not access file “$libdir/postgis-2.4”: No such file or directory"

I am on mac and not really good with terminal. Could anyone help me get my database back?

I am replying to this, with the hope that someone with a solution may notice and provide some solutions.

you could try running the failed command locally to see what it says…

I receive this message:

could not open version file: /usr/local/var/postgres.old/PG_VERSION 
Failure, exiting

I checked and the file exists there. When I try sudo with the command, I receive this:

pg_upgrade: cannot be run as root 
Failure, exiting

Still desperately in need to solve this problem. Even, would be happy if I could role back the installation, if that would help getting my data back.