Restoring groups and linked contacts
If you are confident the users are all there, you could do an import with the CSV dump you mentioned, using the Group ID and Contact ID. 

1) Batch import the groups using the API csv Import module.

2) Assuming the Group IDs could be imported and match up, you could import the users via their internal IDs. Instead of selecting "Group" for the Entity To Import (as in step 1), you can import "GroupContact" and match up the Group ID field and the Contact ID field.