prepare db for merge