Make DCMS migration idempotent

We need to run this manually on production urgently, so best to make
this work without errors.