restoring db before copying files