prepare database for double write