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
Comment #1
amitaibuThank you for taking the time and explaining the solution!
Comment #2
jasonawantHi,
I skipped to identifying and deleting the appropriate field_config.id. This did the trick. Thanks! Jason.
Comment #3
elBradford commentedThanks, the sql in #1 worked for me. Very annoying problem, another indicator that OG isn't for me.
Comment #4
karens commentedIn 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.
Comment #5
mamanerd commented@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):
SELECT * FROM field_config WHERE module LIKE 'og';DELETE FROM field_config WHERE field_config.id = 1 // id may varyComment #6
katannshaw commented@esod, @mamanerd and everyone else, thank you, thank you, thank you!!! What a pain, but your simple instructions helped me out a bunch:)
Comment #7
warmth commented@mamanerd Thank you! :)
Comment #8
omega.OFN commentedHere the "Dummy Solution" (only Admin Interface necessary)
structure->content types->[content-type]->manage fields -> [Field] delete, etc.
(don't forget any "User" fields: configuration->people->account settings->manage fields)
Worked fine for me on a few instances.
Comment #9
nattyweb commentedThank 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.
Comment #10
shushu commentedComment #11
saslib commentedBig 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.
Comment #12
dddbbb commentedVery helpful post - thanks for this.