fix upgrade script to include main post, and fix post indices