migrate msg persistence to db