netcmd: Use dbcheck to fix DB problems introduced by restore itself
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 4 Jul 2018 01:23:59 +0000 (13:23 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 5 Jul 2018 02:01:26 +0000 (04:01 +0200)
commit2860bd0777eff1bff85f2000adf8fe4d788aad56
treec3e155130ef783e4bc5c24fca3d76eb7443c86d2
parent62948a3099cbb6073f3e5e454eaaaadd134e3082
netcmd: Use dbcheck to fix DB problems introduced by restore itself

As part of the restore process, we remove all the old DCs from the DB.
However, this introduces some dbcheck errors - there are some DN
attributes and one-way links that reference the deleted objects that
need fixing up. To resolve this, we can run dbcheck as part of the
restore process. This problem affects both renames and plain restores.

The dbcheck.sh test didn't spot this problem because it fixes this type
of DB error first, before it checks the DB.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/domain_backup.py