fix upgrade error for instances not upgraded from 4.5

fixes #2642

@karlitschek @icewind1991 @schiesbn @VicDeo