Update from OG 1.3 to OG 2.0 failed

idcm - August 21, 2009 - 00:52
Project:Organic groups
Version:6.x-2.0
Component:og.module
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Please help! I need OG running ASAP

There weren't any specific update instructions in the README regarding updates within D6 so I used the process I have done before with other modules. I hope this was right.

1. I disabled organic groups.
2. I also disabled messaging and notifications since I wasn't able to get notifications to send out email notices when someone posted to a group.
3. I deleted OG1.3 from the server and uploaded OG2.0
4. I returned to my site and ran update.php
5. Got the following error message.

Drupal database update

* user warning: Unknown column 'is_public' in 'field list' query: INSERT INTO og_access_post (nid, og_public) SELECT DISTINCT(nid), (SELECT is_public FROM og_ancestry oga_sub WHERE oga_sub.nid = oga.nid LIMIT 1) FROM og_ancestry oga in /home/idcmi/idcminnovations.com/html/sites/all/modules/og/modules/og_access/og_access.install on line 80.
* user warning: Can't DROP 'is_public'; check that column/key exists query: ALTER TABLE og_ancestry DROP is_public in /home/idcmi/idcminnovations.com/html/includes/database.mysql-common.inc on line 322.

Updates were attempted. If you see no failures below, you may proceed happily to the administration pages. Otherwise, you may need to update your database manually. All errors have been logged.

* Main page
* Administration pages

The following queries were executed
og_notifications module
Update #6001

* No queries

og module
Update #6203

* ALTER TABLE {og_ancestry} DROP is_public
* CREATE TABLE {og_ancestry_new} ( `nid` INT NOT NULL, `group_nid` INT NOT NULL ) /*!40100 DEFAULT CHARACTER SET UTF8 */
* INSERT INTO {og_ancestry_new} SELECT DISTINCT * FROM {og_ancestry}
* DROP TABLE {og_ancestry}
* ALTER TABLE {og_ancestry_new} RENAME TO {og_ancestry}
* ALTER TABLE {og_ancestry} ADD PRIMARY KEY (nid, group_nid)

og_access module
Update #6201

* CREATE TABLE {og_access_post} ( `nid` INT NOT NULL, `og_public` TINYINT NOT NULL DEFAULT 1, PRIMARY KEY (nid) ) /*!40100 DEFAULT CHARACTER SET UTF8 */
* Failed: INSERT INTO {og_access_post} (nid, og_public) SELECT DISTINCT(nid), (SELECT is_public FROM {og_ancestry} oga_sub WHERE oga_sub.nid = oga.nid LIMIT 1) FROM {og_ancestry} oga
* Failed: ALTER TABLE {og_ancestry} DROP is_public
* CREATE TABLE {og_ancestry_new} ( `nid` INT NOT NULL, `group_nid` INT NOT NULL ) /*!40100 DEFAULT CHARACTER SET UTF8 */
* INSERT INTO {og_ancestry_new} SELECT DISTINCT * FROM {og_ancestry}
* DROP TABLE {og_ancestry}
* ALTER TABLE {og_ancestry_new} RENAME TO {og_ancestry}
* ALTER TABLE {og_ancestry} ADD PRIMARY KEY (nid, group_nid)

#1

brianosaur - August 29, 2009 - 21:28

I got the same exact error.

#2

rob.carter - September 4, 2009 - 18:01
Status:active» needs review

I believe I've fixed this with a very simple tweak in og_access: change "is_public" to "oga_sub.is_public" in line 80.

I.e., change line 80 to this:

  $ret[] = update_sql("INSERT INTO {og_access_post} (nid, og_public) SELECT DISTINCT(nid), (SELECT oga_sub.is_public FROM {og_ancestry} oga_sub WHERE oga_sub.nid = oga.nid LIMIT 1) FROM {og_ancestry} oga");

I've attached a patch that I believe should work. This is my first time submitting a patch, so please be gentle and tell me if I've done anything incorrectly.

I think you'll need to restore your database to how it was before the failed upgrade attempt before applying the patch/fix.

--Rob

AttachmentSize
og_access.install-v2.0.patch 879 bytes

#3

idcm - September 6, 2009 - 20:32

thanks. i will give it a try on my dev acct. as soon as i can. really appreciate it!
c

#4

moshe weitzman - September 17, 2009 - 13:16

Can anyone confirm that this fixes the problem and preserves data properly?

#5

bwright - September 22, 2009 - 20:37

I just upgraded and got the same errors. It looks like the og module update removes the field 'is_public' from the og_ancestry table then the og_access module update tries to SELECT from that field.

#6

grand_master_v - September 22, 2009 - 23:49

I also get the same error. Followed the same procedure of disabling OG modules, deleting the files, uploading the new files, then running update.php.

#7

idcm - September 25, 2009 - 14:39

I got swamped with work and haven't tested this yet. sorry. Sounds like folks are still having problems. I won't get to it until next month probably. again, sorry for the delay but gotta pay the bills ;-)

#8

rewe - September 30, 2009 - 08:18

same problem here, subscribing ..

#9

rewe - September 30, 2009 - 09:08

the above patch works for me, but only if i don't remove/deinstall og 1.3 before upgrading. so what i did was to replace the og module folder, apply the patch, run update.php - that's it ..

#10

bchristensen - November 4, 2009 - 13:00

I got the exact same errors when trying an upgrade from 5.x to 6.x (5.x-8.1 to 6.x-2.0)

#11

idcm - November 15, 2009 - 15:29

I finally got an opening in my calendar. I tried the patch - no errors! Yippie!!

thanks
c

#12

moshe weitzman - November 17, 2009 - 03:28
Status:needs review» fixed

committed. thanks.

#13

System Message - December 1, 2009 - 03:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.