public void RestoreFromSnapshot(Snapshot snapshot) { if (snapshot == null) { throw new ArgumentNullException(nameof(snapshot)); } var dataFile = dbFileProvider.GetDatabaseFile(); fileService.Replace(snapshot.File, dataFile); logger.Debug($"Restored database {dataFile.Name} using {snapshot.File.Name}"); }
public void RestoreDatabaseBackup(string backupFilenameToRestore) { var backupFile = backupFileProvider.GetBackupFileFromFilename(backupFilenameToRestore); var dbFile = fileProvider.GetDatabaseFile(); fileService.Replace(backupFile, dbFile); }
public void TakeDatabaseBackup(string name) { var backupFile = backupFileProvider.GetBackupFileFromBackupName(name); var dbFile = dbFileProvider.GetDatabaseFile(); snapshotFileService.Copy(dbFile, backupFile); }