Upgrade Foreman 3.6 to 3.7 but Postgresql 10

Basically, what has happened is that for some reason, your DB is not properly indexed.
I don’t know how this has happened to you, but you can take a look at this thread: Possible to use Leapp for Oracle 7 -> Oracle 8 migration? - #9 by evgeni
The comment I linked you to is the first in a long list of posts about this topic which came up because the docs missed a needed reindex of the DB when upgrading from EL 7 to EL8.
While you are not using EL, it looks like you ran into the same problem. Try to fix this first (there’s a lot off suggestions on this in the thread) and then redo the DB dump and you should be good.
I assume this post specificly should help you with your problem: Possible to use Leapp for Oracle 7 -> Oracle 8 migration? - #11 by evgeni

1 Like