Merge databases