How To Merge Two Databases?

I have two databases. Most of the groups therein have the same names. I want to merge them. As a result I want to achieve an only one database wherein nothing is duplicated but all data have being merged. How can I get it?

How many groups actually? In case of not too many groups you could move all of them to the desired database, sort the groups by name, then select a pair of groups and use Tools > Merge etc.