コード例 #1
0
 public string CopyTableDataFromCloneSite(string fromPath, string toPath, List <string> tables)
 {
     try
     {
         string         xmlPath   = Path.Combine(toPath, "App_Data\\XML");
         BaseConfigInfo oldConfig = BaseConfigs.Deserialize(Path.Combine(fromPath, "config\\db.config"));
         oldConfig.DBConnectionString = oldConfig.DBConnectionString.Replace("{$App}", fromPath);
         BaseConfigInfo newConfig = BaseConfigs.Deserialize(Path.Combine(toPath, "config\\db.config"));
         newConfig.DBConnectionString = newConfig.DBConnectionString.Replace("{$App}", toPath);
         DBMigrator.DoMigrate(xmlPath, oldConfig, newConfig, tables);
         return("0");
     }
     catch (Exception ex)
     {
         string source = "We7.CMS.Install-InstallWebService—CopyTableDataFromCloneSite";
         EventLogHelper.WriteToLog(source, ex);
         throw We7Helper.RaiseException("CopyTableDataFromCloneSite", ex.Message, "", ex.Source, We7Helper.FaultCode.Server);
     }
 }