locked
Transfer.TransferData fails with tables with ErrorCode column RRS feed

  • Question

  • I'm very new to working SMO, so forgive me if I'm doing something blatantly wrong. 

    We are working on doing a slow migration of client's from one deployment to another of our CRM 2011 product. We've decided to code this process using SMO however I'm running into an issue with the transfer process. The code is very basic/straightforward. 

    var transfer = new Transfer(sourceDatabase);
    transfer.DestinationServer = destinationSMOServer.Name;
    transfer.DestinationDatabase = destinationDeploymentOrganization.DatabaseName;
    transfer.DestinationLoginSecure = destinationSqlServer.pareto_DirectConnectionAuthenticatonMethod.Value != 586470001; //Option for windows auth or SQL auth
    
    if (!transfer.DestinationLoginSecure)
    {
    	transfer.DestinationLogin = username;
    	transfer.DestinationPassword = password;
    }
    transfer.CopyAllObjects = true;
    transfer.CopyAllUsers = true;
    transfer.Options.WithDependencies = true;
    transfer.CopySchema = true;
    transfer.CopyData = true;
    transfer.PrefetchObjects = true;
    transfer.TemporaryPackageDirectory = "C:\\logs\\";
    transfer.Options.ContinueScriptingOnError = true;
    
    _tracingManager.Trace("Transfer Source: {0}SourceServer: {1}{0}SourceDatabase: {2}{0}", Environment.NewLine, transfer.Database.Name, transfer.Database.Parent.Name);
    _tracingManager.Trace("Transfer Destination: {0}DestinationServer: {1}{0}DestinationDatabase: {2}{0}DestinationLoginSecure: {3}{0}", Environment.NewLine, transfer.DestinationServer, transfer.DestinationDatabase, transfer.DestinationLoginSecure);
    
    
    var destinationDeploymentService = Utils.DeploymentUtils.CreateDeploymentService(organizationService, destinationDeployment);
    try
    {
    	var destinationDb = new Database(destinationSMOServer, destinationDeploymentOrganization.DatabaseName);
    	destinationDb.Create();
    	
    	//foreach( var scrrrr in transfer.ScriptTransfer())
    	//	_tracingManager.Trace("{0}{1}--------------------------------------------------------------{1}",scrrrr,Environment.NewLine);
    
    	//Start the transfer
    	transfer.TransferData();
    }
    catch (Exception ex)
    {
    	CleanupFailedOrgCreate(destinationSMOServer, destinationDeploymentService, destinationDeploymentOrganization);
    	_tracingManager.Trace("CRM Organization deleted and database has been removed. Retransfer possible", ex);
    	throw;
    }

    And here's the error I'm receiving.

    Microsoft.SqlServer.Management.Common.TransferException: ERROR : errorCode=-1073451000 description=The package contains two objects with the duplicate name of "output column "ErrorCode" (114)" and "output column "ErrorCode" (14)".

    I can't find which one has id 114, but the table for 14 is WorkflowLogBase. 

    From what I've read around is internally the Transfer object is building some internal tables with a column called ErrorCode which ends up conflicting with any tables being transferred. 

    Any suggestions for getting around this issue would be hugely appreciated!


    Thank you in advance for your help. If you think you may be able to help with any of my unanswered threads please look at them here


    Friday, March 8, 2013 5:42 PM

All replies

  • Interestingly this doesn't result in an error, however it doesn't transfer any of the data... 
    var script = transfer.ScriptTransfer();
    destinationDb.ExecuteNonQuery(script);


    Thank you in advance for your help. If you think you may be able to help with any of my unanswered threads please look at them here

    Friday, March 8, 2013 6:09 PM
  • I am facing the same error. Any solution?
    Wednesday, September 4, 2013 7:29 AM
  • I ended up not being able to get it to work so I had to do backup/zip/transfer/restore.

    Thank you in advance for your help. If you think you may be able to help with any of my unanswered threads please look at them here

    Wednesday, September 4, 2013 3:26 PM