There is no way to transfer object ids nor node ids from one ez database to another.
That's why is bad practice to have hard coded ids in the templates. At least create special your.ini with those ids in it and then reference them with ezini operator in your templates. So when you migrate content you only need to change one ini file.
Yes, this is the best thing, so you don't need to maintain id list on install. As of 4.1 there should be fetch function support and override support to use remote_id, so you can safely use that (but do note that some bugs surrounding it was fixed in 4.2 and 4.3, especially #15639)