Grab the information from the file, turn it into an array, then loop through it and call `groups_create_group()` every time. You can find that function in bp-groups.php. It tells you all the parameters you need to fill in.
Is it possible to just import the groups in the database?
Almost anything is possible, but creating a simple loop would be 100 times easier. Just importing to the database would be rough for creating groups.
Well, I have this file now: http://pastie.org/1430022
I have opened it in my browser and I get a blank screen (no errors) but the groups isn’t created.
What should I do?
I got a dump from the script and fixed some glitches:
Hers the dump:
‘Array ( [0] => Array ( [group_id] => 2 [creator_id] => 1 [name] => GroupName1 [description] => Interesting description1 [slug] => groupname1 [date_created] => 2011-01-05 02:33:54 [status] => public [enable_forum] => 1 ) [1] => Array ( [group_id] => 3 [creator_id] => 1 [name] => GroupName2 [description] => Interesting description2 [slug] => groupname2 [date_created] => 2011-01-05 02:33:54 [status] => public [enable_forum] => 1 )’
It seems fine but it doesn’t create any groups! ARG!