API Import fails to bring Exhibits

I’m trying to use the “API Import” plugin to bring all items, collections, and exhibits from an Omeka site on one of my servers to another. It’s working for bringing items and collections over, but the exhibits are failing. I turned on debug logging and the error is below. Both servers are on the same version of Omeka (2.4.1) with the same version of Exhibit Builder (3.3.1). The target server has version 1.1.1 of API Import. If anyone has any suggestions, I’d love to hear them. Thanks!

The source omeka instance is up at
https://library.lehigh.edu/omeka/
if anyone wants to try the import themselves and see what happens.

Here’s the MySQL error and stacktrace, which repeats for a bunch of the exhibits that fail to come over in the import, though strangely not all of them:

2017-01-25T21:29:30-05:00 INFO (6): Importing exhibits page 1
2017-01-25T21:29:30-05:00 INFO (6): exhibits ID: 1
2017-01-25T21:29:30-05:00 INFO (6): exception 'Zend_Db_Statement_Mysqli_Exception' with message 'Mysqli statement execute error : No data supplied for parameters in prepared statement' in /usr/local/omeka-2.4.1/application/libraries/Zend/Db/Statement/Mysqli.php:214
Stack trace:
#0 /usr/local/omeka-2.4.1/application/libraries/Zend/Db/Statement.php(303): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /usr/local/omeka-2.4.1/application/libraries/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#2 /usr/local/omeka-2.4.1/application/libraries/Zend/Db/Adapter/Abstract.php(756): Zend_Db_Adapter_Abstract->query(Object(Omeka_Db_Select), Array)
#3 [internal function]: Zend_Db_Adapter_Abstract->fetchRow(Object(Omeka_Db_Select), Array)
#4 /usr/local/omeka-2.4.1/application/libraries/Omeka/Db.php(79): call_user_func_array(Array, Array)
#5 /usr/local/omeka-2.4.1/application/libraries/Omeka/Db/Table.php(670): Omeka_Db->__call('fetchRow', Array)
#6 /usr/local/omeka-2.4.1/application/libraries/Omeka/Db/Table.php(670): Omeka_Db->fetchRow(Object(Omeka_Db_Select), Array)
#7 /usr/local/omeka-2.4.1/plugins/OmekaApiImport/models/Table/OmekaApiImportRecordIdMap.php(21): Omeka_Db_Table->fetchObject(Object(Omeka_Db_Select))
#8 /usr/local/omeka-2.4.1/plugins/OmekaApiImport/libraries/ApiImport/ResponseAdapter/Omeka/GenericAdapter.php(114): Table_OmekaApiImportRecordIdMap->localRecord('User', NULL, 'http://library....')
#9 /usr/local/omeka-2.4.1/plugins/OmekaApiImport/libraries/ApiImport/ResponseAdapter/Omeka/GenericAdapter.php(85): ApiImport_ResponseAdapter_Omeka_GenericAdapter->getLocalUserId(Array)
#10 /usr/local/omeka-2.4.1/plugins/OmekaApiImport/libraries/ApiImport/ResponseAdapter/Omeka/GenericAdapter.php(38): ApiImport_ResponseAdapter_Omeka_GenericAdapter->setFromResponseData()
#11 /usr/local/omeka-2.4.1/plugins/OmekaApiImport/libraries/ApiImport/ImportJob/Omeka.php(88): ApiImport_ResponseAdapter_Omeka_GenericAdapter->import()
#12 /usr/local/omeka-2.4.1/plugins/OmekaApiImport/libraries/ApiImport/ImportJob/Omeka.php(31): ApiImport_ImportJob_Omeka->importRecords('exhibits', Object(ApiImport_ResponseAdapter_Omeka_GenericAdapter))
#13 /usr/local/omeka-2.4.1/application/libraries/Omeka/Job/Process/Wrapper.php(29): ApiImport_ImportJob_Omeka->perform()
#14 /usr/local/omeka-2.4.1/application/scripts/background.php(61): Omeka_Job_Process_Wrapper->run(Array)
#15 {main}

I’ll try the import to see what turns up. One detail in the trace I want to ask about, though. It looks like it is trying to import some user data, which might mean that you are doing the import using a key for a super user. Is that accurate?

Huh. Looking at the site’s API without a key, it is giving some odd data, saying that the owner ID of the exhibit is null. That’s not as it should be, but not sure exactly where or why that’s happening.

I did use an API key from a super user – I thought I needed to in order to get everything. I’m not sure if the old site has content that’s non-public though. Maybe I could get everything without using the key. I also always checked the “Override element set data” checkbox. I could try leaving that unchecked.

I also see the NULL owner IDs now that you mention it. I’ll see about giving the exhibits all valid owners.

I don’t see a way in the web interface to set the owner of an exhibit. Think it would be okay to just fix this with SQL? I could easily just do an
update exhibits set owner_id= where owner_ID is NULL;

Those seem like reasonable workarounds to get the job done. Just doing another import without the key might also pull the content in. I think it’d just assign the owner to you.

This is a bug somewhere, though, so I’ll keep working on identifying it.

Okay, once I just used SQL on the source servers database to give the exhibits with NULL owner_id values a valid owner ID (mine), the API import on the new server worked. It got all the items, exhibits, and collections, which is what I was after. Thanks for the help @patrickmj !