In SharePoint, we have a features called shared services which means you configure the service in one farm and shared across multiple farm by building the trust between farm. mainly known as publishing and consuming farm relationship.
- In your farm A, you configure UPA (with all custom properties) and now publish so that other farm can consume. your farm A will become Publishing farm. It not only serve the services to itself but others farm
- Farm B, Now we configure the trust and consume the UPA from farm A. this farm will called as consuming farm. No local UPA required.
Not all service can be shared, there are only few and UPA is one of them.
Please read this complete guide from Technet: Share service applications across farms in SharePoint 2013
Building trust is straight forward but before doing understand the concept. here are the keyp Steps.
- Build a Trust between farm:
- On Consuming Farm( farm B in your case), export two certificate (Root certificate and STS). move the certificate to publishing farm (farm a In your case).
- On Publishing Farm (farm A) export the root certificate. move it to consuming Farm ( Farm B).
- Now Import the 2 Certificate on Publishing farm ( which copied from Farm B)
- Now Import the 1 Certificate on consuming farm ( which copied from Farm A)
Now trust is build between farm.