public override void LoadFromXml(XmlElement xml) { base.LoadFromXml(xml); m_backup = new BackupContainer(); m_backup.LoadFromXml_ForJob(xml.FindElement("Backup")); m_dst = (IDatabaseSource)DatabaseSourceAddonType.Instance.LoadAddon(xml.FindElement("Target")); }
public Backup_TreeNode(ITreeNode parent, IFileHandler fhandler) : base(parent, fhandler) { m_backup = new BackupContainer(m_file.DataDiskPath); if (parent is Backups_TreeNode) { m_conn = ((Backups_TreeNode)parent).m_conn; } }
public void Restore() { try { m_backup.Format.CheckRestoreConfiguration(m_conn); BackupContainer backup = new BackupContainer(m_file.DataDiskPath); RestoreDbForm.Run(m_conn.CloneSource(), backup); } catch (Exception err) { Errors.Report(err); } }
protected override void DoRun(IJobRunEnv env) { string dir = GetBackupDir(); try { Directory.CreateDirectory(dir); } catch { } string bckfile = Path.Combine(dir, CreateFileName()); IDatabaseWriter writer = m_format.GetWriter(bckfile + m_format.Extension, m_src); var copyOpts = new DatabaseCopyOptions { CopyMembers = m_members, DataMode = DbCopyDataMode.All, CopyStructure = true, SchemaMode = m_src.Dialect.DialectCaps.MultipleSchema ? DbCopySchemaMode.Original : DbCopySchemaMode.Explicit, ExplicitSchema = null }; CopyDbJob.CopyDatabase(m_src, writer, ProgressInfo, copyOpts); SetCurWork(Texts.Get("s_finishing")); BackupContainer bc = new BackupContainer(bckfile, m_format); bc.Save(); }
public static Job CreateJob(BackupContainer backup, IDatabaseSource dst, JobProperties jobProps) { return(Job.FromCommand(new RestoreDbJobCommand(backup, dst), jobProps)); }
public RestoreDbJobCommand(BackupContainer backup, IDatabaseSource dst) { m_dst = dst; m_backup = backup; }
public static void Run(IDatabaseSource conn, BackupContainer backup) { if (conn.Connection == null) return; var win = new RestoreDbForm(conn, backup); win.ShowDialogEx(); }
public RestoreDbForm(IDatabaseSource conn, BackupContainer backup) { InitializeComponent(); m_backup = backup; SetDatabase(conn); }