Restore DB "matrix_hipo" does not exist

(Nic Hubbard) #1

We are moving servers so I am testing restoring a backup on our new server. When I use the restore command with the .dump file, it runs for a while and then I start seeing errors:

psql:./data/mysource_matrix-2019-04-01_19-27.dump:3772125: ERROR: role “matrix_hipo” does not exist

Any ideas on why this would happen? Should I be running the restore as a certain user?

(John gill) #2

I don’t think it’s about which user you run the restore as, but making sure that all the required users exist in the fresh database before you restore.

Whenever I restore from a backup, I create all the users from in the new database prior to restoring.

(Marcus Fong) #3

That’s exactly it. You have to create the users and database as per before you can restore. The manual currently names them matrix and matrix_secondary, but some older systems may instead use other names such as matrix_web and matrix_hipo - as John said, you’ll want to match whatever you had before so checking is probably best.

(You used to have to add the plpgsql language too, but on any recent version of PostgreSQL it’s part of the default template.)

(Nic Hubbard) #4

Got it. Thanks everyone!