Search code examples
sql-servervisual-studiomsdeploy

Right parameter setting to ignore data loss on msdeploy with dbDacFx Provider


I'm using msdeploy to synchronize the DB, but the script is always being cancelled due to data loss, even though I explicitly set it up to ignore it. What am I doing wrong?

msdeploy -Verb:Sync -Source:dbDacFx="Data Source=localhost;Initial Catalog=DevelopmentDB;Integrated Security=True;",BlockOnPossibleDataLoss="False" -Dest:dbDacFx="Data Source=localhost;Initial Catalog=ProductionDB;Integrated Security=True;"

This is the final result of the script:

enter image description here


Solution

  • I believe you need to place that parameter on the destination not the source:

    msdeploy -Verb:Sync -Source:dbDacFx="Data Source=localhost;Initial Catalog=DevelopmentDB;Integrated Security=True;" -Dest:dbDacFx="Data Source=localhost;Initial Catalog=ProductionDB;Integrated Security=True;",BlockOnPossibleDataLoss="False"
    

    More details here