MySQL database schema changes

senatus

Joined: 2009-03-24
Posts: 1
Posted: Tue, 2009-03-24 02:55

I upgraded (onto Debian Lenny) Gallery2, dutifully using MySQL Admin to backup the old Gallery 2 database.

With the new Gallery2 installation, which overwrote the database with blank (uninitialized) data, I have a brand spanking new installation, with no data (i.e. pristine).

However after restoring my old database, the new Gallery 2 installation does not work anymore.

Re-restoring the (new, empty) Gallery 2 database gets the installation working again (as one would expect), but I would like to restore all the user data (obviously, I still have the albums in the g2data/albums directories) from the old database.

I notice that there are schema differences between the old gallery2 database and the new one; that is, there are extra tables (e.g. g2_WebDavLockMap) in the new version of gallery2's db.

It is annoying, obviously; I have all the old data in the old database, and it passes consistency checks - but it doesn't map to the schema used by the new Gallery2 database. I.e. "by the book", everything was done right. I really would prefer not to downgrade again - especially since there were zillions of other changes from Etch to Lenny, including library routines, and a switch from Apache 1.3 to Apache 2....

Is there any way I can restore the critical elements (users, permissions, album listings) of the old database? For example, are there just some tables I could restore? That seems to be asking for database corruption.

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 3869
Posted: Tue, 2009-03-24 09:55

You have to restore the Gallery DB to the same version of Gallery as the backup was taken from - regardless of what flavour of Debian you have installed.

Quote:
I really would prefer not to downgrade again

You don't need to touch the server, just install the old version of Gallery, recover the db, then upgrade Gallery properly using the Gallery upgrade procedure which will update the schema for you.

Login or register to post comments