/// <summary> /// Restore database /// </summary> /// <param name="fileName">Backup file name</param> public void RestoreBackup(string fileName) { if (String.IsNullOrEmpty(fileName)) { return; } if (File.Exists(fileName)) { switch (Path.GetExtension(fileName).ToLowerInvariant()) { case ".zip": if (Path.GetFileName(fileName).StartsWith("images")) { using (ZipFile zipFile = new ZipFile(fileName)) { zipFile.ExtractAll(this.LocalFTPFolderPath, ExtractExistingFileAction.OverwriteSilently); } } break; case ".bak": InstallerHelper.RestoreBackup(fileName); break; } } else { throw new CRMException("File doesn't exist"); } }