D7. I have Organic Group (OG) installed. Out of the approximately 150 groups on my website, one is sticky and titled "Welcome New Members." It has about 2,000 members. Recently, a problem developed with that group only and a user gets a 500 error when posting. Another kind of error is "The website encountered a difficulty. Please... blah blah."

The other groups seem to be working fine.

I could be wrong, but it seems to me that the easiest way to fix this is to create another group and transfer all the group members, along with their posts to the new group. Then I could delete the original group and its content.

Looking at the data base table "og_membership" I see that all members of all groups are mixed together in the same table.

I need to extract those nodes and users that belong to that one group. I guess a dump of selected users and nodes based on the group ID could do the trick. But how do I upload them back into the same table with a different gid or etid so they also belong to the new group? Or is there a way in the data base to "search and replace" a group ID (gid) with another?

I have tried the following formula but I am being told it is the wrong syntax (etid is the entity ID:)

update [og_membership] set [etid] = replace([etid],'[776]','[10177]');

Any pointer would be greatly appreciated. :)

1 Answer 1


OK. Finally got it right. The easiest way to do this is to do a dump of the og_membership table into a text file.

Then run a "search and replace" for the gid, replacing the old gid with the new one. A simple word processor is ideal for this. Any string replacement can be handled this way.

Then importing that text file into the og_membership table.

Voila! All members have switched to the new group and they don't even know it! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.