fix db connections for migrations

Signed-off-by: P. Isaac Hildebrandt <king.isaac@gmail.com>
moved deletion of old migration file into upgrade check
This line was causing issues with the connection name being saved in the top level config directory as that
file would be deleted every time migration was loaded

Signed-off-by: P. Isaac Hildebrandt <king.isaac@gmail.com>