@iballou thank you again for your help.
I finally managed to get it all back in order, this is what I did:
- update to the latest RPMs (which included the pulp core fix for double encrypted entries)
- rebooted foreman and the proxy
- ran the datarepair-2327 on the proxy, it repaired some entries
- ran it again on the proxy, this time 0 errors
- ran remove-orphan, which succeeded for the proxy but timed out on the foreman server
- discovered, that pulp-core constantly restarts on the foreman server and identified the cause (md5 is enabled and 40k+ entries didn’t have md5 hashes set)
- did something nasty, ran SQL to set the md5 has to the value “1” for all NULL (I won’t post the SQL command here as I don’t wanna encourage anyone being as “stupidly brave”
- pulp-core did now restart fine
- tried the remove-orphan again, this time it worked on both foreman and the proxy
- handle-artifacts-checksum still failed with that one file which was removed from upstream
- did a repository sync on ALL my repositories (normal sync), as they are set to “data only” for mirroring, removed upstream content is also removed
- discovered, that the RPM in question is still visible in the Foreman GUI
- published and promoted new version of each and every content view
- deleted all previous version of each and every content view
- ran remove-orphan again, successful on both the proxy and foreman server
- used SQL (again boldly brave) to reset the MD5 hash to NULL where it was “1”
- ran handle-artifact-checksums and for the first time it completed successfully, regenerating all MD5 checksums and downloading thousands of missing files (those didn’t survive the pulp2 → pulp3 migration)
- ran SQL to check if I have missing MD5 checksums: 0!
- full sync of the proxy (still running)
So tomorrow I will check for the result of 19 and if all is fine, will be finally back with a fully functioning Foreman/Katello system.
Big thanks to everyone, who helped me throughout this process. Hopefully nobody else encounters those issues after updating too quickly from 3 to 4.