refactored rake task to prep for restore