Include duplicate rules in "Disable validation rules, triggers and flows"
Here's a powershell script I hacked-up to do this from sfdx directories in vs code:
$duplicateRules = ".\force-app\main\default\duplicateRules"
$temporary = -join("duplicateRulessave",[System.Guid]::NewGuid())
Save repository versions
New-Item -ItemType Directory -Path $temporary
Move-Item -Path $duplicateRules*.* -Destination $temporary
Retrieve org versions
sf project retrieve start --metadata DuplicateRule
Make deactivated versions
$files = Get-ChildItem -Path $duplicateRules -Filter "*.xml"
foreach ($file in $files) {
$content = Get-Content $file.FullName
if ($content -match "<isActive>true</isActive>") {
$content -replace "<isActive>true</isActive>", "<isActive>false</isActive>" | Set-Content $file.FullName
} else {
Remove-Item $file.FullName
}
}
Deploy deactivated versions
sf project deploy start --metadata DuplicateRule
Restore repository versions
Remove-Item $duplicateRules*.* | Where-Object{!($_.PSIsContainer)}
Move-Item -Path $temporary*.* -Destination $duplicateRules
Remove-Item $temporary
$duplicateRules = $null
$temporary = $null