fix a migration bug (setting value even when undefined)

added migration for matching night mode foreground / background - closes #1432