Drupaling Folks,

I upgraded my 4.6.6 installation successfully to 4.7 rc3 and save
for my 'og' module, all went well. During the og bit of the update,
a number of mySQL DB errors were logged on the update screen.

Here's the online summary of those

Duplicate column name 'website' query: ALTER
Can't DROP 'PRIMARY'; check that
Duplicate column name 'is_admin' query: ALTER ...
Duplicate column name 'is_active' query: ...
Duplicate column name 'og_role' query: ALTER ...

As per the latest instructions, I had setup the og module folder
with the og 4.7 version code with the og.install file as well. So
I think the update attempted to upgrade the DB to og 4.7 and
failed. For the timebeing I had disabled og to work on other stuff.

I'd like to get og to work again, and it looks the update left the DB
in some inconsistent state. When I enable og in the settings
(in 4.7.rc3 upgraded status) after enabling the module, I start seeing
big red SQL warning messages.

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ISNULL(na.gid)' at line 1 query: SELECT n.nid FROM node n LEFT JOIN node_access na ON n.nid = na.nid AND realm LIKE '%og%' WHERE n.type NOT IN () AND ISNULL(na.gid) in /path/to/site/includes/database.mysql.inc on line 120.

Since I don't have any active groups, I will be happy to start with a
fresh install of og, but don't know how to kill off the residual stuff,
since it already seems to have some done 'something' to the DB,
especially on the access control aspects.

How do I clean this up? I'm ready to move the site upto 4.7.0 as
well, but wanted to get advice on resolving this in line with or before
taking that step. I have the DBA module installed and generally use
to view and backup the DB. All advice greatly appreciated!!

Comments

slazenger’s picture

I had to dig into the DB tables; it looks like the og tables were still 4.6 format or in whatever format that incompatible with 4.7; the upgrade did not take care of that;
so even though I had deleted all the groups and emptied the og and og_uid tables,
I was still getting mySQL errors during OG operations in 4.7-rc3 (which had the latest
version of the og module as of early May 06.)

I was having similar mysql errors with events and flexinode, all coming from the flexinode
module.

To fix this mess, I did the following.

1. disabled og, flexinode, events modules

2. deleted all related content (like old event postings)

3. Emptied tables

4. Upgraded from 4.7-rc3 to 4.7.0 -- this went fine.

5. Upgraded the org, event and flexinode modules to latest

6. Even here, the .install files did not upgrade the og and flexinode DB
tables.

7. So I dropped the old tables, and used the SQL create code in the
.install files and recreated the og and flexinode tables

8. After this I renabled og, flexinode and events.

9. Since then, I've been able to create and use new groups, as well events.

So far so good.

I wish there was some warning issued when the update.php runs, and
gives you the impression that it is updating modules, and in fact does not
really update the DB tables for that module. I think this is where I got
confused.

Many thanks to the developers of Drupal and these modules - despite the
hitches; overall, its great functionality and I appreciate all the effort
people have put in.