This is not a mojoPortal bug.
There is a sequence that creates the usereid for new rows but its starting with 1 and this is a duplicate key because of the existing rows. I think you would need to alter the sequence so it starts at a number higher than any existing userid.
You also will need to hook the users up to roles correctly in mp_userroles.
Maybe somethinglike this will work:
ALTER SEQUENCE mp_userroles_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
you would need to change the START WITH to a number higher than any existing userid.
Not sure if this will work as I'm not a pgsql super guru, but thats what I would try.
Hope it helps,
Joe