[3.8] Fix #1619 Upgrade migration, checks if sbas exists before getting connec...

...tion