fix some scripts for migrate old system format