updated to restore db before copying files