Problem PG::ConnectionBad when merging two forums despite several previous successes

Thanks @McFly for putting together a complete guide. This is helpful. Can all of these steps be automated? And create a cron job for it?