We're early enough in the development phase of our project that we decided to go with Organic Groups 7.x-2.x. Although it means re-doing our configuration, the upgrade path we decided on was to delete 7.x-1.3 and start over.

Uninstalling 7.x-1.3 turned into a bit of a challenge. There doesn't seem to be much information available on uninstalling Organic Groups. I am writing this issue in case others are looking for this information.

Initially I could not get OG to uninstall. The OG checkbox remained stubbornly grayed out in admin/modules/list and drush pm-disable disabled all the other OG modules except Organic Groups. Drush reported that "og is a required module and can't be disabled."

These are all the steps I took to successfully uninstall Organic Groups.

Delete all OG fields at admin/reports/fields
Disable and remove any features modules that require OG

drush pm-disable og
All Organic Groups modules are now disabled except Organic Groups.

drush pm-info og
lists entity list and options as Requires. I temporarily disable those modules, being careful not to uninstall (delete) their tables. After completing this un-installation, I will reenable those modules and the other modules that were disabled with:

drush en entity, options, views_bulk_operations, bean, bean_admin_ui, entityreference, field_collection, title, blockreference, references, user_reference

But first, I issue the drush command to disable entity list and options

drush dis entity list options

Now Organic Groups in admin/modules/list is unchecked, but when I attempt to uninstall the table og, Drupal throws a DatabaseSchemaObjectExistsException error.

I found this discussion, http://drupal.org/node/1284332, from which I figured out that a row in the field_config table was holding things up. First I identify the row with:

SELECT * FROM field_config WHERE module LIKE 'og';

and with

DELETE FROM field_config WHERE field_config.id = 1 // id may vary

the problem was solved. admin/modules/list shows the checkbox for Organic Groups as tickable. admin/modules/uninstall uninstalls the module table without error.

Now it's on to Organic Groups 7.x-2.x!

Comments

amitaibu’s picture

Thank you for taking the time and explaining the solution!

jasonawant’s picture

Hi,

I skipped to identifying and deleting the appropriate field_config.id. This did the trick. Thanks! Jason.

elBradford’s picture

Thanks, the sql in #1 worked for me. Very annoying problem, another indicator that OG isn't for me.

karens’s picture

In D7, fields are not completely deleted when you delete them in the UI, they are just marked for deletion. They are completely deleted when you run cron. So it is possible that the problem with the undeleted item would be fixed by inserting a step of running cron after deleting all the og fields. That would completely remove them and the system should not object when you try to disable the module.

mamanerd’s picture

@esod and @c4jwant, thanks for steering me in the right direction!

Here's how I disabled and uninstalled OG (NOTE: I did not have any OG content yet):

  1. Go to phpMyAdmin and click the "SQL" tab.
  2. Enter the following query in the SQL box and click "Go".
    SELECT * FROM field_config WHERE module LIKE 'og';
  3. Write down or remember the number from the first column of the SQL results. This is the field_config ID that you'll be deleting in the next step.
  4. Enter the following query in the SQL box, replacing the "1" with the ID you got in the previous step. Then click "Go".
    DELETE FROM field_config WHERE field_config.id = 1 // id may vary
  5. You should now be able to disable all of the OG modules using either the Modules UI page or Drush pm-disable og.
  6. After disabling all OG modules, make sure you uninstall them too (admin/modules/uninstall).
  7. Clear all caches.
katannshaw’s picture

@esod, @mamanerd and everyone else, thank you, thank you, thank you!!! What a pain, but your simple instructions helped me out a bunch:)

warmth’s picture

@mamanerd Thank you! :)

omega.OFN’s picture

Here the "Dummy Solution" (only Admin Interface necessary)

  1. Delete any OG fields out of admin/reports/fields
    structure->content types->[content-type]->manage fields -> [Field] delete, etc.
    (don't forget any "User" fields: configuration->people->account settings->manage fields)
  2. Uncheck all OG Modules under /admin/modules (except "Organic Groups" - probably blocked)
  3. Run cron (see comment #4)
  4. Uncheck "Organic Groups" under admin/modules (finally)
  5. Uninstall any OG Modules (first) and Organic Groups (admin/modules/uninstall)
  6. Delete OG-folder from your sites/all/modules directory
  7. Clear your caches

Worked fine for me on a few instances.

nattyweb’s picture

Thank to all for this collection of advice. It was a remaining OG field that was the key for me - deleted and then disable/uninstall worked perfectly. I followed the cron and clear cache actions too, just to be on the safe side. So far, so good.

shushu’s picture

Status: Active » Closed (works as designed)
saslib’s picture

Big thanks from me also. After months of trial and error, I was finally able to migrate from OG 7.x-1.5 to 7.x-2.7 I only had to delete the group_group field from the Group creator content type and the database record found by the SQL command, then I could uninstall successfully. On installing 2.x, I enabled OG, OG UI, and OG access control modules and re-checked the Group box in the Group creator content type and almost all other settings from 1.x remained intact. I did have to repopulate the membership of the Groups, though. And the Groups Directory needed to be set up in a different way in Views.

dddbbb’s picture

Very helpful post - thanks for this.