@caseybea no problem! The more issues we solve here the better for the future.
The Pulp team gave me a command to try before we drop the entire DB:
sudo systemctl stop pulpcore* --all
sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' /usr/bin/pulpcore-manager shell -c "import pulpcore; pulpcore.app.models.ReservedResource.objects.all().delete()"
sudo systemctl restart pulpcore* --all
For other people joining us, please only run the above command if you have not run the Pulp 3 switchover and are willing to have to run through the full Pulp 3 migration again. It is a dangerous operation!
Then, I’d say try running orphan cleanup because it should take much less time than the migration. If orphan cleanup doesn’t get stuck, you should be good to run the migration.
If orphaned cleanup gets stuck, here are the commands to reset the database:
sudo systemctl stop pulpcore*
sudo su - postgres
dropdb pulpcore
createdb pulpcore
exit
cd /tmp
sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' /usr/bin/pulpcore-manager migrate --no-input
sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' /usr/bin/pulpcore-manager reset-admin-password --password <some random password>
sudo systemctl restart pulpcore*