I'm assuming that the sample you refer to uses two EntityManagers with different datasource extensions to connect to different databases and then queries the data from the first EM adds it to the second EM and saves.
First of all that's about the most inefficient way of copying data. That's a huge overhead just to copy data. You better handle this at the database level.
Anyway, if you want to do it this way, you just create two EntityManagerProviders with different ConnectionOptions.