Commit 0e9c5d3a0145c31401cee2b23a9563098a036f20

Authored by Schwirg László
1 parent 4e5cf08c

v1.26.0.0

- DBBackup remote SQL serverről
Vrh.Log4Pro.MaintenanceConsole/Manager - SQLDataBaseManager.cs
@@ -70,8 +70,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.SQLDataBaseManagerNS @@ -70,8 +70,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.SQLDataBaseManagerNS
70 var dbname = SQLDataBaseManagerCore.GetDBName(sqld.SQLCS); 70 var dbname = SQLDataBaseManagerCore.GetDBName(sqld.SQLCS);
71 ColorConsole.WriteLine($"Database backup process started. DB key:'{key}', name:'{dbname}'...", ConsoleColor.Yellow); 71 ColorConsole.WriteLine($"Database backup process started. DB key:'{key}', name:'{dbname}'...", ConsoleColor.Yellow);
72 if (!string.IsNullOrWhiteSpace(targetfolder)) { sqld.Xml_BackupTargetDirectoryPath = targetfolder; } 72 if (!string.IsNullOrWhiteSpace(targetfolder)) { sqld.Xml_BackupTargetDirectoryPath = targetfolder; }
73 - if (enabledbbackup) { SQLDataBaseManagerCore.CreateBackup(sqld.Xml_BackupTargetDirectoryPath, sqld.SQLCS, sqld.Xml_BackupFileNameMask, sqld.Xml_CreateZip, timestamp); }  
74 - if (enablescriptbackup) { SQLDataBaseManagerCore.BackupSqlScripts(sqld.Xml_BackupTargetDirectoryPath, sqld.Xml_BackupFileNameMask, sqld.SQLCS, sqld.Xml_CreateZip, timestamp); } 73 + if (enabledbbackup) { SQLDataBaseManagerCore.CreateBackup(sqld,null, timestamp); }
  74 + if (enablescriptbackup) { SQLDataBaseManagerCore.BackupSqlScripts(sqld, timestamp); }
75 if (enabletabledatabackup) { SQLDataBaseManagerCore.BackupSqlData(sqld, timestamp); } 75 if (enabletabledatabackup) { SQLDataBaseManagerCore.BackupSqlData(sqld, timestamp); }
76 ColorConsole.WriteLine($"Database backup process finished!", ConsoleColor.DarkGreen); 76 ColorConsole.WriteLine($"Database backup process finished!", ConsoleColor.DarkGreen);
77 } 77 }
@@ -135,7 +135,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.SQLDataBaseManagerNS @@ -135,7 +135,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.SQLDataBaseManagerNS
135 try 135 try
136 { 136 {
137 137
138 - SQLDataBaseManagerCore.BackupSqlScripts(sqld.Xml_BackupTargetDirectoryPath, sqld.Xml_BackupFileNameMask,sqld.SQLCS,sqld.Xml_CreateZip,TS); 138 + SQLDataBaseManagerCore.BackupSqlScripts(sqld,TS);
139 ColorConsole.WriteLine($"SQLDB code scripts created. Name:{sqld.Xml_Description}", ConsoleColor.Green); 139 ColorConsole.WriteLine($"SQLDB code scripts created. Name:{sqld.Xml_Description}", ConsoleColor.Green);
140 } 140 }
141 catch (Exception ex) { ColorConsole.WriteLine(ex.Message, ConsoleColor.Red); } 141 catch (Exception ex) { ColorConsole.WriteLine(ex.Message, ConsoleColor.Red); }
@@ -164,7 +164,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.SQLDataBaseManagerNS @@ -164,7 +164,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.SQLDataBaseManagerNS
164 SQLDataBase ssqldb = p.Parameters as SQLDataBase; 164 SQLDataBase ssqldb = p.Parameters as SQLDataBase;
165 try 165 try
166 { 166 {
167 - SQLDataBaseManagerCore.CreateBackup(ssqldb.Xml_BackupTargetDirectoryPath, ssqldb.SQLCS, ssqldb.Xml_BackupFileNameMask, ssqldb.Xml_CreateZip,TS); 167 + SQLDataBaseManagerCore.CreateBackup(ssqldb,null,TS);
168 ColorConsole.WriteLine($"Database backup created. Name:{ssqldb.DBName}", ConsoleColor.Green); 168 ColorConsole.WriteLine($"Database backup created. Name:{ssqldb.DBName}", ConsoleColor.Green);
169 } 169 }
170 catch (Exception ex) { ColorConsole.WriteLine(ex.Message, ConsoleColor.Red); } 170 catch (Exception ex) { ColorConsole.WriteLine(ex.Message, ConsoleColor.Red); }
@@ -212,7 +212,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.SQLDataBaseManagerNS @@ -212,7 +212,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.SQLDataBaseManagerNS
212 if (ms == null) { continue; } 212 if (ms == null) { continue; }
213 selectedbackupfilepath = ms.SelectedParameterList.First().Parameters.ToString(); 213 selectedbackupfilepath = ms.SelectedParameterList.First().Parameters.ToString();
214 } 214 }
215 - SQLDataBaseManagerCore.RestoreBackup(st.SQLCS, selectedbackupfilepath, targetdirectorypath, restorefromzip, targetdbname); 215 + SQLDataBaseManagerCore.RestoreBackup(st, selectedbackupfilepath, targetdirectorypath, restorefromzip, targetdbname);
216 ColorConsole.WriteLine($"Database '{st.DBName}' restored to '{targetdbname}' into directory '{targetdirectorypath}'.", ConsoleColor.Green); 216 ColorConsole.WriteLine($"Database '{st.DBName}' restored to '{targetdbname}' into directory '{targetdirectorypath}'.", ConsoleColor.Green);
217 } 217 }
218 else 218 else
@@ -729,13 +729,20 @@ GO @@ -729,13 +729,20 @@ GO
729 729
730 public static void RelocatePhysicalFiles(SQLDataBase sqld, string targetdirectory, string restoredbname) 730 public static void RelocatePhysicalFiles(SQLDataBase sqld, string targetdirectory, string restoredbname)
731 { 731 {
732 - var dbbackupfilepath = CreateBackup(sqld.Xml_BackupTargetDirectoryPath, sqld.SQLCS, sqld.Xml_BackupFileNameMask, false); 732 + var dbbackupfilepath = CreateBackup(sqld, false,null);
733 if (dbbackupfilepath == null) return; 733 if (dbbackupfilepath == null) return;
734 - RestoreBackup(sqld.SQLCS, dbbackupfilepath, targetdirectory, false, restoredbname); 734 + RestoreBackup(sqld, dbbackupfilepath, targetdirectory, false, restoredbname);
735 if (File.Exists(dbbackupfilepath)) { File.Delete(dbbackupfilepath); } 735 if (File.Exists(dbbackupfilepath)) { File.Delete(dbbackupfilepath); }
736 } 736 }
737 - public static void RestoreBackup(string sqlcs, string sourcesqlbackupfilepath, string targetdbphysicalfilesdirectorypath, bool restorefromZIP = false, string restoretodbname = null) 737 + public static void RestoreBackup(SQLDataBase sqldb, string sourcesqlbackupfilepath, string targetdbphysicalfilesdirectorypath, bool restorefromZIP = false, string restoretodbname = null)
738 { 738 {
  739 + if (sqldb.Xml_IsRemoteDB)
  740 + {
  741 + ColorConsole.WriteLine(text: $" {nameof(RestoreBackup)}: data restore is not available for remote SQL Servers! DBname:'{sqldb.DBName}'.", prefix: $"WARNING!", f: ConsoleColor.Yellow);
  742 + return;
  743 + }
  744 +
  745 + string sqlcs = sqldb.SQLCS;
739 string backupfilepath; 746 string backupfilepath;
740 if (restorefromZIP) 747 if (restorefromZIP)
741 { 748 {
@@ -783,60 +790,107 @@ GO @@ -783,60 +790,107 @@ GO
783 if (File.Exists(backupfilepath)) { File.Delete(backupfilepath); } 790 if (File.Exists(backupfilepath)) { File.Delete(backupfilepath); }
784 } 791 }
785 } 792 }
786 - public static string CreateBackup(string backupdirectorypath, string sqlconnectionstring, string backupfilenamemask, bool createzip = false,DateTime? timestamp=null) 793 +
  794 + /// <summary>
  795 + /// Create SQL DB backup
  796 + /// </summary>
  797 + /// <param name="sqld">az sql db-t leíró descriptor</param>
  798 + /// <param name="forcecreatezip"></param>
  799 + /// <param name="timestamp"></param>
  800 + /// <returns></returns>
  801 + public static string CreateBackup(SQLDataBase sqld,bool? forcecreatezip, DateTime? timestamp)
787 { 802 {
  803 + string backupdirectorypath = sqld.Xml_BackupTargetDirectoryPath;
  804 + string tranzitdirectorypathlocal = sqld.Xml_TranzitDirectoryPathLocal;
  805 + string tranzitdirectorypathnetwork = sqld.Xml_TranzitDirectoryPathNetwork;
  806 + bool usetranzit = sqld.Xml_IsRemoteDB;
  807 + string sqlconnectionstring = sqld.SQLCS;
  808 + string backupfilenamemask = sqld.Xml_BackupFileNameMask;
  809 + bool createzip = forcecreatezip ?? sqld.Xml_CreateZip;
  810 + //tranzitdirectorypathlocal = @"F:\ALM";
  811 + //tranzitdirectorypathnetwork = @"\\matng-sql01\ALM";
788 var sqlserver = SQLServerConnect(sqlconnectionstring); 812 var sqlserver = SQLServerConnect(sqlconnectionstring);
  813 + if (sqlserver == null)
  814 + {
  815 + ColorConsole.WriteLine($"ERROR! Database connection string error. '{sqlconnectionstring}'", ConsoleColor.Red);
  816 + return null;
  817 + }
  818 +
789 string returnfilename = null; 819 string returnfilename = null;
790 - if (sqlserver != null)  
791 - {  
792 - var dbname = GetDBName(sqlconnectionstring); 820 + var dbname = GetDBName(sqlconnectionstring);
793 821
794 - var backupts = (timestamp.HasValue ? timestamp.Value : DateTime.Now).ToString("yyyyMMddHHmmss");  
795 -  
796 - string backupfileNameOnly = Path.GetFileNameWithoutExtension(backupfilenamemask);  
797 - var vars = new Dictionary<string, string>();  
798 - vars.Add(nameof(DBSubstitutionName.DATABASE), GetDBName(sqlconnectionstring));  
799 - vars.Add(nameof(DBSubstitutionName.DATASOURCE), GetDataSource(sqlconnectionstring));  
800 - vars.Add(nameof(DBSubstitutionName.DBOTYPE), "DBBACKUP");  
801 - vars.Add(nameof(DBSubstitutionName.DBONAME), "");  
802 - vars.Add(nameof(DBSubstitutionName.DBDATAGROUP), "");  
803 - vars.Add(nameof(DBSubstitutionName.BACKUPTS), backupts); 822 + var backupts = (timestamp.HasValue ? timestamp.Value : DateTime.Now).ToString("yyyyMMddHHmmss");
804 823
805 - backupfileNameOnly = VRH.Common.StringConstructor.ResolveConstructorR(vars, backupfileNameOnly, "{}@@");  
806 -  
807 - string backupfilename = backupfileNameOnly + ".bak";  
808 - string backupFullName = Path.Combine(backupdirectorypath, backupfilename);  
809 - if (File.Exists(backupFullName)) { File.Delete(backupFullName); }  
810 -  
811 - var smoBackup = new Backup();  
812 - smoBackup.Action = BackupActionType.Database;  
813 - smoBackup.BackupSetDescription = $"Full Backup of {sqlserver.ConnectionContext.DatabaseName}";  
814 - smoBackup.BackupSetName = sqlserver.ConnectionContext.DatabaseName + " Backup";  
815 - smoBackup.Database = sqlserver.ConnectionContext.DatabaseName;  
816 - smoBackup.MediaDescription = "Disk";  
817 - smoBackup.Devices.AddDevice(backupFullName, DeviceType.File);  
818 - //smoBackup.  
819 - smoBackup.PercentComplete += SmoBackup_PercentComplete;  
820 - smoBackup.PercentCompleteNotification = 1;  
821 - smoBackup.SqlBackupAsync(sqlserver);  
822 - Console.WriteLine("");  
823 - smoBackup.Wait();  
824 - Console.WriteLine("");  
825 -  
826 - returnfilename = backupFullName; 824 + string backupfileNameOnly = Path.GetFileNameWithoutExtension(backupfilenamemask);
  825 + var vars = new Dictionary<string, string>();
  826 + vars.Add(nameof(DBSubstitutionName.DATABASE), GetDBName(sqlconnectionstring));
  827 + vars.Add(nameof(DBSubstitutionName.DBKEY), sqld.Xml_Key);
  828 + vars.Add(nameof(DBSubstitutionName.DATASOURCE), GetDataSource(sqlconnectionstring));
  829 + vars.Add(nameof(DBSubstitutionName.DBOTYPE), "DBBACKUP");
  830 + vars.Add(nameof(DBSubstitutionName.DBONAME), "");
  831 + vars.Add(nameof(DBSubstitutionName.DBDATAGROUP), "");
  832 + vars.Add(nameof(DBSubstitutionName.BACKUPTS), backupts);
  833 +
  834 + backupfileNameOnly = VRH.Common.StringConstructor.ResolveConstructorR(vars, backupfileNameOnly, "{}@@");
  835 +
  836 + string backupfilename = backupfileNameOnly + ".bak";
  837 + string backupFullName = Path.Combine(backupdirectorypath, backupfilename);
  838 + string tranzitFullNameLocal= usetranzit ? Path.Combine(tranzitdirectorypathlocal, backupfilename) : null;
  839 + string tranzitFullNameNetwork= usetranzit ? Path.Combine(tranzitdirectorypathnetwork, backupfilename) : null;
  840 + if (File.Exists(backupFullName)) { File.Delete(backupFullName); }
  841 +
  842 +
  843 + var smoBackup = new Backup();
  844 + smoBackup.Action = BackupActionType.Database;
  845 + smoBackup.BackupSetName = sqlserver.ConnectionContext.DatabaseName + " Backup";
  846 + smoBackup.BackupSetDescription = $"Full Backup of {sqlserver.ConnectionContext.DatabaseName}";
  847 + smoBackup.MediaDescription = "Disk";
  848 + Console.WriteLine($"Backup set: {smoBackup.BackupSetName} ({smoBackup.BackupSetDescription}) to media: {smoBackup.MediaDescription}");
  849 + smoBackup.Database = sqlserver.ConnectionContext.DatabaseName;
  850 + string dummystring = usetranzit ? " REMOTE SQL SERVER!" : "";
  851 + Console.WriteLine($"Database name: {smoBackup.Database}{dummystring}");
  852 + Console.WriteLine($"Connection string: {sqld.SQLCS}");
  853 + smoBackup.Devices.AddDevice(usetranzit ? tranzitFullNameLocal : backupFullName, DeviceType.File);
  854 + Console.WriteLine($"Backup full name:{backupFullName}");
  855 + if (usetranzit)
  856 + {
  857 + Console.WriteLine($" ...will be created through tranzit: {tranzitFullNameNetwork}");
  858 + }
  859 + smoBackup.PercentComplete += SmoBackup_PercentComplete;
  860 + smoBackup.PercentCompleteNotification = 1;
  861 + smoBackup.SqlBackupAsync(sqlserver);
  862 + var startbackup = DateTime.Now;
  863 + smoBackup.Wait();
  864 + Console.WriteLine($"");
  865 + Console.WriteLine($"Backup completed. Backup time: {(int)(DateTime.Now.Subtract(startbackup).TotalSeconds)}sec.");
  866 + if (usetranzit && File.Exists(tranzitFullNameNetwork))
  867 + {
  868 + File.Move(tranzitFullNameNetwork, backupFullName);
  869 + Console.WriteLine($"Moving backup file...");
  870 + Console.WriteLine($" ...from tranzit location: {tranzitFullNameNetwork}");
  871 + Console.WriteLine($" ...to backup location: {backupFullName}");
  872 + }
  873 + returnfilename = backupFullName;
  874 + if (File.Exists(backupFullName))
  875 + {
827 if (createzip) 876 if (createzip)
828 { 877 {
  878 + var startcompressing = DateTime.Now;
829 string ZIPbackupfilename = backupfileNameOnly + ".zip"; 879 string ZIPbackupfilename = backupfileNameOnly + ".zip";
830 string ZIPbackupFullName = Path.Combine(backupdirectorypath, ZIPbackupfilename); 880 string ZIPbackupFullName = Path.Combine(backupdirectorypath, ZIPbackupfilename);
831 if (File.Exists(ZIPbackupFullName)) { File.Delete(ZIPbackupFullName); } 881 if (File.Exists(ZIPbackupFullName)) { File.Delete(ZIPbackupFullName); }
832 882
833 - ZipTools.CreateEntriesFromDirectoryContent(backupdirectorypath, ZIPbackupFullName, backupfilename, "","", removearchivedfiles: false, storepathinzip: false);  
834 - if (File.Exists(backupFullName)) { File.Delete(backupFullName); } 883 + ZipTools.CreateEntriesFromDirectoryContent(backupdirectorypath, ZIPbackupFullName, backupfilename, "", "", removearchivedfiles: false, storepathinzip: false);
  884 + File.Delete(backupFullName);
  885 + Console.WriteLine($"Zipping completed. Compressing time: {(int)(DateTime.Now.Subtract(startcompressing).TotalSeconds)}sec.");
835 returnfilename = ZIPbackupFullName; 886 returnfilename = ZIPbackupFullName;
836 } 887 }
837 - ColorConsole.WriteLine($"Database backup created. DB name:'{dbname}'. BAK/ZIP file name:'{Path.GetFileName(returnfilename)}'", ConsoleColor.DarkGreen); 888 + ColorConsole.WriteLine($"SUCCESS! Database backup created. DB name:'{dbname}'. BAK/ZIP file name:'{Path.GetFileName(returnfilename)}'", ConsoleColor.DarkGreen);
  889 + }
  890 + else
  891 + {
  892 + ColorConsole.WriteLine($"ERROR! Database backup failed. DB name:'{dbname}'. BAK/ZIP file name:'{Path.GetFileName(returnfilename)}'", ConsoleColor.Red);
838 } 893 }
839 - else { ColorConsole.WriteLine($"SQL scripts create: error in db connection string. '{sqlconnectionstring}'", ConsoleColor.DarkGreen); }  
840 return returnfilename; 894 return returnfilename;
841 } 895 }
842 896
@@ -1074,7 +1128,7 @@ GO @@ -1074,7 +1128,7 @@ GO
1074 #region DBSubstitution 1128 #region DBSubstitution
1075 public enum DBSubstitutionName 1129 public enum DBSubstitutionName
1076 { 1130 {
1077 - DATABASE,DATASOURCE,DBOTYPE,DBONAME,DBDATAGROUP,BACKUPTS,SHRINKOPTION,SHRINKFREESPACEPERCENT, 1131 + DBKEY,DATABASE,DATASOURCE,DBOTYPE,DBONAME,DBDATAGROUP,BACKUPTS,SHRINKOPTION,SHRINKFREESPACEPERCENT,
1078 } 1132 }
1079 #endregion DBSubstitution 1133 #endregion DBSubstitution
1080 #region ExecuteSQLScript 1134 #region ExecuteSQLScript
@@ -1233,8 +1287,17 @@ GO @@ -1233,8 +1287,17 @@ GO
1233 } 1287 }
1234 #endregion ExecuteSQLStoredProcedure 1288 #endregion ExecuteSQLStoredProcedure
1235 #region BackupSqlScripts 1289 #region BackupSqlScripts
1236 - public static void BackupSqlScripts(string backupdirectorypath,string backupfilenamemask,string sqlcs,bool createZip, DateTime? timestamp=null) 1290 + public static void BackupSqlScripts(SQLDataBase sqld, DateTime? timestamp=null)
1237 { 1291 {
  1292 + if (sqld.Xml_IsRemoteDB)
  1293 + {
  1294 + ColorConsole.WriteLine(text:$" {nameof(BackupSqlScripts)}: scrip backup is not available for remote SQL Servers! DBname:'{sqld.DBName}'.",prefix:$"WARNING!",f: ConsoleColor.Yellow);
  1295 + return;
  1296 + }
  1297 + string backupdirectorypath = sqld.Xml_BackupTargetDirectoryPath;
  1298 + string backupfilenamemask = sqld.Xml_BackupFileNameMask;
  1299 + string sqlcs = sqld.SQLCS;
  1300 + bool createZip = sqld.Xml_CreateZip;
1238 var sqlserver = SQLServerConnect(sqlcs); 1301 var sqlserver = SQLServerConnect(sqlcs);
1239 var dbname = GetDBName(sqlcs); 1302 var dbname = GetDBName(sqlcs);
1240 if (sqlserver!=null) 1303 if (sqlserver!=null)
@@ -1345,6 +1408,11 @@ GO @@ -1345,6 +1408,11 @@ GO
1345 #region BackupSqlData 1408 #region BackupSqlData
1346 public static void BackupSqlData(SQLDataBase sqld,DateTime? timestamp=null) 1409 public static void BackupSqlData(SQLDataBase sqld,DateTime? timestamp=null)
1347 { 1410 {
  1411 + if (sqld.Xml_IsRemoteDB)
  1412 + {
  1413 + ColorConsole.WriteLine(text: $" {nameof(BackupSqlData)}: data backup as scripts is not available for remote SQL Servers! DBname:'{sqld.DBName}'.", prefix: $"WARNING!", f:ConsoleColor.Yellow);
  1414 + return;
  1415 + }
1348 string sqlcs = sqld.SQLCS; 1416 string sqlcs = sqld.SQLCS;
1349 var sqlserver = SQLServerConnect(sqlcs); 1417 var sqlserver = SQLServerConnect(sqlcs);
1350 var dbname = GetDBName(sqlcs); 1418 var dbname = GetDBName(sqlcs);
@@ -1494,6 +1562,8 @@ GO @@ -1494,6 +1562,8 @@ GO
1494 Xml_BackupFileNameMask = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.BackupFileNameMask), this.RootElement, SQLDataBase.XmlStructure.Attributes.BackupFileNameMask.Values.DEFAULT), 1562 Xml_BackupFileNameMask = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.BackupFileNameMask), this.RootElement, SQLDataBase.XmlStructure.Attributes.BackupFileNameMask.Values.DEFAULT),
1495 Xml_RestoreFileNameMask = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.RestoreFileNameMask), this.RootElement, SQLDataBase.XmlStructure.Attributes.RestoreFileNameMask.Values.DEFAULT), 1563 Xml_RestoreFileNameMask = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.RestoreFileNameMask), this.RootElement, SQLDataBase.XmlStructure.Attributes.RestoreFileNameMask.Values.DEFAULT),
1496 Xml_BackupTargetDirectoryPath = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.BackupTargetDirectoryPath), this.RootElement, SQLDataBase.XmlStructure.Attributes.BackupTargetDirectoryPath.Values.DEFAULT), 1564 Xml_BackupTargetDirectoryPath = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.BackupTargetDirectoryPath), this.RootElement, SQLDataBase.XmlStructure.Attributes.BackupTargetDirectoryPath.Values.DEFAULT),
  1565 + Xml_TranzitDirectoryPathLocal = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.TranzitDirectoryPathLocal), this.RootElement, SQLDataBase.XmlStructure.Attributes.TranzitDirectoryPathLocal.Values.DEFAULT),
  1566 + Xml_TranzitDirectoryPathNetwork = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.TranzitDirectoryPathNetwork), this.RootElement, SQLDataBase.XmlStructure.Attributes.TranzitDirectoryPathNetwork.Values.DEFAULT),
1497 Xml_PhysicalFilesDirectoryPath = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.PhysicalFilesDirectoryPath), this.RootElement, SQLDataBase.XmlStructure.Attributes.PhysicalFilesDirectoryPath.Values.DEFAULT), 1567 Xml_PhysicalFilesDirectoryPath = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.PhysicalFilesDirectoryPath), this.RootElement, SQLDataBase.XmlStructure.Attributes.PhysicalFilesDirectoryPath.Values.DEFAULT),
1498 Xml_ScriptCommandTimeout = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.ScriptCommandTimeout), this.RootElement, SQLDataBase.XmlStructure.Attributes.ScriptCommandTimeout.Values.DEFAULT), 1568 Xml_ScriptCommandTimeout = GetValue(nameof(SQLDataBase.XmlStructure.Attributes.ScriptCommandTimeout), this.RootElement, SQLDataBase.XmlStructure.Attributes.ScriptCommandTimeout.Values.DEFAULT),
1499 }; 1569 };
@@ -1521,6 +1591,9 @@ GO @@ -1521,6 +1591,9 @@ GO
1521 public string Xml_BackupFileNameMask; 1591 public string Xml_BackupFileNameMask;
1522 public string Xml_RestoreFileNameMask; 1592 public string Xml_RestoreFileNameMask;
1523 public string Xml_BackupTargetDirectoryPath; 1593 public string Xml_BackupTargetDirectoryPath;
  1594 + public string Xml_TranzitDirectoryPathLocal;
  1595 + public bool Xml_IsRemoteDB { get { return !string.IsNullOrWhiteSpace(Xml_TranzitDirectoryPathLocal); } }
  1596 + public string Xml_TranzitDirectoryPathNetwork;
1524 public string Xml_SQLConnectionString; 1597 public string Xml_SQLConnectionString;
1525 public string Xml_PhysicalFilesDirectoryPath; 1598 public string Xml_PhysicalFilesDirectoryPath;
1526 public int Xml_ScriptCommandTimeout; 1599 public int Xml_ScriptCommandTimeout;
@@ -1552,6 +1625,8 @@ GO @@ -1552,6 +1625,8 @@ GO
1552 Xml_BackupFileNameMask = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.BackupFileNameMask), sqldatabasexml, common.Xml_BackupFileNameMask); 1625 Xml_BackupFileNameMask = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.BackupFileNameMask), sqldatabasexml, common.Xml_BackupFileNameMask);
1553 Xml_RestoreFileNameMask = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.RestoreFileNameMask), sqldatabasexml, common.Xml_RestoreFileNameMask); 1626 Xml_RestoreFileNameMask = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.RestoreFileNameMask), sqldatabasexml, common.Xml_RestoreFileNameMask);
1554 Xml_BackupTargetDirectoryPath = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.BackupTargetDirectoryPath), sqldatabasexml, common.Xml_BackupTargetDirectoryPath); 1627 Xml_BackupTargetDirectoryPath = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.BackupTargetDirectoryPath), sqldatabasexml, common.Xml_BackupTargetDirectoryPath);
  1628 + Xml_TranzitDirectoryPathLocal = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.TranzitDirectoryPathLocal), sqldatabasexml, common.Xml_TranzitDirectoryPathLocal);
  1629 + Xml_TranzitDirectoryPathNetwork = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.TranzitDirectoryPathNetwork), sqldatabasexml, common.Xml_TranzitDirectoryPathNetwork);
1555 Xml_SQLConnectionString = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.SQLConnectionString), sqldatabasexml, XmlStructure.SQLDataBase.Attributes.SQLConnectionString.Values.DEFAULT); 1630 Xml_SQLConnectionString = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.SQLConnectionString), sqldatabasexml, XmlStructure.SQLDataBase.Attributes.SQLConnectionString.Values.DEFAULT);
1556 1631
1557 Xml_CreateZip = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.CreateZip), sqldatabasexml, common.Xml_CreateZip); 1632 Xml_CreateZip = GetValue(nameof(XmlStructure.SQLDataBase.Attributes.CreateZip), sqldatabasexml, common.Xml_CreateZip);
@@ -1579,6 +1654,8 @@ GO @@ -1579,6 +1654,8 @@ GO
1579 Xml_BackupFileNameMask = sqld.Xml_BackupFileNameMask; 1654 Xml_BackupFileNameMask = sqld.Xml_BackupFileNameMask;
1580 Xml_RestoreFileNameMask = sqld.Xml_RestoreFileNameMask; 1655 Xml_RestoreFileNameMask = sqld.Xml_RestoreFileNameMask;
1581 Xml_BackupTargetDirectoryPath = sqld.Xml_BackupTargetDirectoryPath; 1656 Xml_BackupTargetDirectoryPath = sqld.Xml_BackupTargetDirectoryPath;
  1657 + Xml_TranzitDirectoryPathLocal = sqld.Xml_TranzitDirectoryPathLocal;
  1658 + Xml_TranzitDirectoryPathNetwork = sqld.Xml_TranzitDirectoryPathNetwork;
1582 Xml_SQLConnectionString = sqld.Xml_SQLConnectionString; 1659 Xml_SQLConnectionString = sqld.Xml_SQLConnectionString;
1583 Xml_PhysicalFilesDirectoryPath = sqld.Xml_PhysicalFilesDirectoryPath; 1660 Xml_PhysicalFilesDirectoryPath = sqld.Xml_PhysicalFilesDirectoryPath;
1584 Xml_SQLDataList = sqld.Xml_SQLDataList.Select(x => new SQLData(x)).ToList(); 1661 Xml_SQLDataList = sqld.Xml_SQLDataList.Select(x => new SQLData(x)).ToList();
@@ -1593,6 +1670,8 @@ GO @@ -1593,6 +1670,8 @@ GO
1593 public static class BackupFileNameMask { public static class Values { public const string DEFAULT = ""; } } 1670 public static class BackupFileNameMask { public static class Values { public const string DEFAULT = ""; } }
1594 public static class RestoreFileNameMask { public static class Values { public const string DEFAULT = ""; } } 1671 public static class RestoreFileNameMask { public static class Values { public const string DEFAULT = ""; } }
1595 public static class BackupTargetDirectoryPath { public static class Values { public const string DEFAULT = ""; } } 1672 public static class BackupTargetDirectoryPath { public static class Values { public const string DEFAULT = ""; } }
  1673 + public static class TranzitDirectoryPathLocal { public static class Values { public const string DEFAULT = ""; } }
  1674 + public static class TranzitDirectoryPathNetwork { public static class Values { public const string DEFAULT = ""; } }
1596 public static class PhysicalFilesDirectoryPath { public static class Values { public const string DEFAULT = ""; } } 1675 public static class PhysicalFilesDirectoryPath { public static class Values { public const string DEFAULT = ""; } }
1597 public static class ScriptCommandTimeout { public static class Values { public const int DEFAULT = 10000; } } 1676 public static class ScriptCommandTimeout { public static class Values { public const int DEFAULT = 10000; } }
1598 1677
@@ -1609,6 +1688,8 @@ GO @@ -1609,6 +1688,8 @@ GO
1609 public static class BackupFileNameMask { } 1688 public static class BackupFileNameMask { }
1610 public static class RestoreFileNameMask { } 1689 public static class RestoreFileNameMask { }
1611 public static class BackupTargetDirectoryPath { } 1690 public static class BackupTargetDirectoryPath { }
  1691 + public static class TranzitDirectoryPathLocal { }
  1692 + public static class TranzitDirectoryPathNetwork { }
1612 public static class CreateZip { } 1693 public static class CreateZip { }
1613 public static class PhysicalFilesDirectoryPath { } 1694 public static class PhysicalFilesDirectoryPath { }
1614 public static class ScriptCommandTimeout { public static class Values { public const int DEFAULT = 10000; } } 1695 public static class ScriptCommandTimeout { public static class Values { public const int DEFAULT = 10000; } }
Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices; @@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
32 // You can specify all the values or you can default the Build and Revision Numbers 32 // You can specify all the values or you can default the Build and Revision Numbers
33 // by using the '*' as shown below: 33 // by using the '*' as shown below:
34 // [assembly: AssemblyVersion("1.0.*")] 34 // [assembly: AssemblyVersion("1.0.*")]
35 -[assembly: AssemblyVersion("1.25.2.0")]  
36 -[assembly: AssemblyFileVersion("1.25.2.0")] 35 +[assembly: AssemblyVersion("1.26.0.0")]
  36 +[assembly: AssemblyFileVersion("1.26.0.0")]