netcmd: Add --site option when restoring a domain
commit1e7520f4e50ab369769d11b7d65a3752d6aeeda5
authorTim Beale <timbeale@catalyst.net.nz>
Mon, 17 Sep 2018 03:36:21 +0000 (17 15:36 +1200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 5 Nov 2018 11:44:29 +0000 (5 12:44 +0100)
tree12a97d1a6ae851b3713d57036ed05ad03dd1d046
parent6c44382e5fa889fb13085075755a7aa245ffff03
netcmd: Add --site option when restoring a domain

Restoring a backup only worked if the Default-First-Site-Name site was
still present. When the new restored DC account is created, it was
trying to add the new server's DN under CN=Default-First-Site-Name.
However, if the original domain was setup using a different site, then
the restore would fail because the DN didn't exist.

When running the restore command, you should be able to specify the
site that you want the new/restored DC to be in (same as during a
DC 'join'). Passing the correct --site argument is one way to avoid
this problem. (A subsequent patch will further improve the tool so it
can work around non-default sites automatically).

Note we also need to pass the site through to where the new DNS entries
get registered (in the rename case).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13621

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit e1f255a4d54b59924295ea875fdef62ccebb8811)
python/samba/netcmd/domain_backup.py