Details
Say two teams both use different Phabricator instances, and you want to coalesce them. Is there an easy way to import the history from Team A's install into Team B? I don't think there is, but is there even a hard way to do it?
I suspect the answer is rather complicated, if it's possible at all - although the most important thing to preserve would be the differential history.
Answers
There's no easy way to do this.
The hard way is probably fairly hard, and will basically involve copying the database data over row-by-row.
Some of the issues I expect you'll run into: IDs will collide; PHIDs of objects present on both systems (like users and repositories) will collide; the data is stored in a lot of different tables with many IDs and PHIDs connecting them, many of which will need to be remapped; references to objects like D1 in comments will now point at the wrong objects; although most data is contained in the relevant application's database (e.g., most review data is in phabricator_differential), some is not (e.g., rows in the edge table reference rows in other databases).
See also T3179 for general discussion of this class of importers. That task focuses on importing from non-Phabricator external systems instead of Phabricator systems, but most of the discussion is likely relevant, and we'd probably treat the problem the same way if we were to build upstream support.
You could possibly maintain the old install as read-only and enforce that technically after T4571 if it proves necessary.
You can pay us to do this for you (see Consulting) but I'd guess the cost for this at our consulting rates is wildly out of line with how valuable it is. I think we also aren't really going to be able to do this all that much faster than anyone else. (If you do move forward and get stuck or aren't sure how to tackle a subproblem, that might be an option to help you get unstuck, though.)
After Nuance (T8783), we expect to have a more formal import pipeline and it's conceivable to me that we'd be open to pursuing upstream support for something in this vein, but the timeline on that isn't currently very clear. It's also a large amount of work, and probably 2-3 months between prioritizing it and delivering a usable pipeline.