Naive DB upgrade support

(cherry picked from commit 6f8487f61a9f6cd65c14b2dd019c4b8bc9d15f15)