vCenter Server provides the ability to backup and restore the configuration of a vSphere Distributed Switch.
You can import or export a configuration of a distributed switch including its port groups.
Hosts/VMs are configured automatically on the DVS when a DVS is imported on a existing VCenter or new VCenter seamlessly resolving the proxy errors.
Note: You can use a saved configuration file to restore policies and hosts associations on the distributed switch. You cannot restore the connection of physical NICs to uplink ports or ports of link aggregation groups.
VMware ESXi 7.x
VMware ESXi 8.x
Use the exported configuration file to do the following tasks:
Create a copy of the exported distributed switch in a vSphere environment. See Import a vSphere Distributed Switch Configuration.
Overwrite the settings on an existing distributed switch. See Restore a vSphere Distributed Switch Configuration.
You can also export, import, and restore only port group configurations. See Export, Import, and Restore vSphere Distributed Port Group Configurations.
You can import a stored configuration file to create a new vSphere Distributed Switch or to restore a switch that has been deleted earlier
The configuration file contains the networking settings of the switch. By using it you can also replicate the switch in other virtual environments.
Note: You can use a saved configuration file to replicate the switch instance, its host associations, and policies. You cannot replicate the connection of physical NICs to uplink ports or ports on link aggregation groups.
You can use the Preserve original distributed switch and port group identifiers option in the following cases:
All port groups are recreated and the hosts that have been connected to the switch are added again.
VMs are also mapped to the imported DVS portgroups automatically.
Reasoning:
When importing the distributed virtual switch (DVS) with the "Preserve original distributed switch" option selected, the cSwitch ID and VM port ID are retained.
As a result, when the switch is imported and the host is added (either automatically or manually if importing into a different vCenter), the host recognizes the DVS.
This is because it retains a proxy copy of the same switch, creating the impression that it is identical to the one the host previously used. Consequently, VMs and port groups are automatically configured, and any proxy-related errors are resolved seamlessly.
Disclaimer: This procedure should not be used to move hosts from one VCenter to the other when its a part of the DVS. For the standard procedure recommended by VMware by Broadcom to move the host gracefully refer Moving an ESXi host with DVS from one VCenter to another