Trouble upgrading from 1.9.0.beta11

I’m trying to upgrade from Discourse 1.9.0.beta11 that needed a postgres upgrade. Postgres upgrade seemed OK, but now rebuild fails with:

Caused by:                                                                                                                              
PG::DependentObjectsStillExist: ERROR:  cannot drop table users column email because other objects depend on it                         
DETAIL:  trigger users_email_readonly on table users depends on table users column email                                                
HINT:  Use DROP ... CASCADE to drop the dependent objects too.               

Predictably, I can’t restore that backup to an up-to-date Discourse.

I’m not quite sure how I’d make use of the hint to DROP ... CASCADE.

If someone else has the problem and manages to find this, moving the postgres_data_old back to postgres_data and restarting the old container got the site back up, but I’m not sure how to get things upgraded.

This is why not to wait 14 months between upgrades, people! :wink:

Here’s how to restore such a backup

In general, as there were quite some of these issues in the 1.9.x versions, it’s best to first go to the latest Discourse version and then upgrade Postgres. Latest still works fine on 9.5, there is no need to upgrade Postgres first.

Oh, since you got it up and running again: to avoid this just run db:seed_fu before you backup or upgrade Postgres.

2 Likes

Thanks, @michaeld! I don’t know why I didn’t search, but this is a great response.

Oh. That’s a good tip, though I’m not sure how to do that on a standard install.

I was going to suggest to just delete this topic since the linked post has the answer, but . . .

Aha! That seems like the best tip of all, as a mere mortal can conceivably run db:seed_fu before an upgrade. Upgrading without having Postgres update first and poking around in a tar file to edit SQL, not so much. :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.