public function restore(&$dump) {
        $this->_adjustDumpToEnvironment($dump);
        //$dump         = $this->_lowerCaseTableAndViewNames($dump);
        $this->_removeDefinerCalls($dump);
        $dbConfig       = $this->getDbConfigParams();
        $restoreFile    = $this->getRestoreFilePath();
        $restoreDir     = $this->getBackupDir();

        $executeFile    = new Garp_Shell_Command_CreateDatabase($dbConfig);
        $this->shellExec($executeFile);

        if (!$this->_validateDump($dump)) {
            throw new Exception("The fetched database seems invalid.");
        }

        $createRestoreDir = new Garp_Shell_Command_CreateDir($restoreDir);
        $this->shellExec($createRestoreDir);

        if ($this->store($restoreFile, $dump)) {
            $executeFile = new Garp_Shell_Command_ExecuteDatabaseDumpFile($dbConfig, $restoreFile);
            $this->shellExec($executeFile);

            $removeFile = new Garp_Shell_Command_RemoveFile($restoreFile);
            $this->shellExec($removeFile);
        }
    }