1.2.1 Installation Upgrading Database Error

Omeka encountered an error when upgrading your installation:
Error in Migration #1
Message: Migration file does not exist for #1!

The site actually does work except for i featured item.
Any clues about this error before I upgrade to 2.2.2?

Migration #1 is a very old migration, from well before Omeka's 1.0 release. It sounds like your database is missing the piece of data that's supposed to tell Omeka what version the database is at.

Are you currently on version 1.2.1, or upgrading to it?

The version on the admin page says 1.2.1, but has a message at the top to upgrade the DB.

I have a backup of the DB before i upgraded. i'm working with Dreamhost to restore it since the interface doesn't provide an obvious way of uploading a local file.

It sounds like i might not need to. Is there another way to fix it?

If you were upgrading from version 1.0, your migration number should be 35. You can set that by adding a row to your options table, with the key migration and the value 35.

now I get:

Error in Migration #38

Message: Mysqli statement execute error : Duplicate column name 'version

This is why losing that migration number in the database is problematic. It becomes hard to tell what version the database is actually already upgraded to.

This error indicates that your database was something higher than version 1.0 already. You can try increasing the number to see if you have more success, or look at your backup to see if it still has the migration number stored.

Version 1.1's migration number is 42. Versions 1.2 and 1.2.1 are both migration number 47.

OK John,

47 worked. I'd like to upgrade it 2.2.2 and from what I've read, that can be done straight from 1.2.1, yes?

I did try this once but the documentation really didn't describe what to expect after copying the new files over and renaming a few folders. I went to admin which did nothing. Somehow i figured out to go to admin/upgrade which gave me an upgrade button. When I clicked it, I received no output or if it was doing anything.

I'm a little hesitant about trying again. Can you give me an idea of what it should do so I know it worked?

Actually, going to admin when you've installed an upgraded version of the Omeka files should automatically redirect you to the upgrade page.

When you clicked the button, you got no output at all? Just a white screen? You should get a status page either reporting that the upgrade completed, or a page reporting an error if one occurred.

Well, this time upgrading to 2.2.2 did automatically go to admin upgrade, but it just shows a white screen with nothing on it. The main page says: Public site is unavailable until the upgrade completes.

I GREATLY appreciate your help, John

After going back to 1.2.1, I've noticed that there's one featured item that causes the error:

"Error:An item has not been set to be displayed on this theme page! Please see Omeka documentation for details."

Could this cause the issue with moving to 2.2.2?

Have you tried enabling error reporting and seeing if there's any message instead of the white screen?

That helped. I get:

Fatal error: Cannot redeclare show_untitled_items() (previously declared in /home/sunyoneonta/cgpcommunitystories.org/admin/themes/default/custom.php:15) in /home/sunyoneonta/cgpcommunitystories.org/application/views/scripts/functions.php on line 17

Ah, that error makes sense, it's just a problem with your theme.

When you're upgrading to the 2.2 files, are you following the Upgrading instructions from the documentation? The error you're getting is something you'd see if you were still using some old 1.x files. In particular, it's because you have an old version of the admin theme getting used.

Generally, you should be starting with a clean copy of the new files and just copying things like your db.ini over, not unzipping the new version on top of the old or otherwise having some mixture of the two.

We're gettin' there.

-------------------------------------
Omeka encountered an error when upgrading your installation.

SQL error in migration: Mysqli statement execute error : Duplicate column name 'added'

Please restore from your database backup and try again. If you have any questions please refer to Omeka documentation or post a message on the Omeka forums.
----------------------------------------

I'm not sure here. I'm reading this as there's a duplicate column in the DB labeled 'added'. Don't think a DB can have 2 fields named the same. - Or more likely I'm just an idiot.

You're reading the error correctly. Did it give any other information, like a traceback?

Was that a "first try" on the upgrade, or did you click the button more than one time without re-restoring your backup first?

This is exactly what it says:

Omeka encountered an error when upgrading your installation.

SQL error in migration: Mysqli statement execute error : Duplicate column name 'added'

Please restore from your database backup and try again. If you have any questions please refer to Omeka documentation or post a message on the Omeka forums.

The database was a good copy of 1.2.1 and I only clicked the button once.

I guess I need to turn error reporting on again.

Well I restarted with a clean DB at 1.2.1 and after deleting the older files, uploaded all the 2.2.2 files.

i found 5 instances of a field named 'added' in the DB so I renamed them all as 'addedold'. Before I clicked upgrade, I turned on error reporting and I got the exact same error as above.

The error console showed:
TypeError: undefined is not a function (evaluating 'Object.extend') - globals.js:81

Try turning on debug.exceptions in your config.ini file also. That should get you a traceback added to that error message identifying which migration and which line are causing the problem.

Then it will be easier to see if there's some problem with your 1.2.1 database, or something else happening.

OK - here's the trace:

#0 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Zend/Db/Statement.php(303): Zend_Db_Statement_Mysqli->_execute(Array)

#1 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)

#2 [internal function]: Zend_Db_Adapter_Abstract->query('ALTER TABLE `om...')

#3 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Omeka/Db.php(79): call_user_func_array(Array, Array)

#4 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Omeka/Db.php(282): Omeka_Db->__call('query', Array)

#5 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Omeka/Db.php(282): Omeka_Db->query('ALTER TABLE `om...')

#6 /home/sunyoneonta/cgpcommunitystories.org/application/migrations/20100810120000_detachCollectorsFromEntities.php(36): Omeka_Db->queryBlock('ALTER TABLE `om...')

#7 /home/sunyoneonta/cgpcommunitystories.org/application/migrations/20100810120000_detachCollectorsFromEntities.php(19): detachCollectorsFromEntities->_migrateCollections(Object(Omeka_Db))

#8 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Omeka/Db/Migration/Manager.php(231): detachCollectorsFromEntities->up()

#9 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Omeka/Db/Migration/Manager.php(111): Omeka_Db_Migration_Manager->_migrateUp(Object(DateTime))

#10 /home/sunyoneonta/cgpcommunitystories.org/application/controllers/UpgradeController.php(43): Omeka_Db_Migration_Manager->migrate()

#11 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Zend/Controller/Action.php(516): UpgradeController->migrateAction()

#12 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('migrateAction')

#13 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))

#14 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(101): Zend_Controller_Front->dispatch()

#15 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()

#16 /home/sunyoneonta/cgpcommunitystories.org/application/libraries/Omeka/Application.php(79): Zend_Application->run()

#17 /home/sunyoneonta/cgpcommunitystories.org/admin/index.php(28): Omeka_Application->run()

#18 {main}

Any word on the previous post, John?