You can export vSphere distributed port group configurations to a file. The configuration file allows you to preserve valid port group configurations, enabling distribution of these configurations to other deployments.
You can export port group information at the same time you export distributed switch configurations. See Backing Up and Restoring a vSphere Distributed Switch Configuration.