Import error

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 34
Joined: Tue Jul 22, 2008 12:30 pm

Import error

Postby makemywish » Sun Oct 06, 2013 8:34 am

I have been trying to import a users xml file (exported from 2.2.2) into a fresh install of OJS (2.4.2).

Whenever I try to import, of around 400 users, only 48 are being imported and the following resultant error message is displayed:
"DB Error: Column 'first_name' cannot be null".

There are no user names with blank first names. A validation check identifies 113 errors. It is not clear what the error message means (this is a sample of the error message from

Line File name: users.xml
28 Column: 3137
Error: Content of element type "user" must match "(username?,password?,salutation?,first_name,middle_name?,last_name,initials?,gender?,affiliation?,signature?,email,url?,phone?,fax?,mailing_address?,country?,interests*,biography*,locales?,role*)".
Error Position:
...hor"/><role type="reader"/></user><user><username>maria_xxxxxxxx</usernam

Any help would be appreciated

Posts: 34
Joined: Tue Jul 22, 2008 12:30 pm

Re: Import error

Postby makemywish » Sun Oct 06, 2013 10:24 am

OK. It turns out 2.2.2 exported the user data in a different order (signature after email) and the latest DTD wants it in a different order. Now the XML file is valid -- yet the web site returns a "DB Error: Column 'first_name' cannot be null". error.

What is going on?

Posts: 34
Joined: Tue Jul 22, 2008 12:30 pm

Re: Import error

Postby makemywish » Sun Oct 06, 2013 10:50 am

Turns out only the first 48 entries are being imported and it stopped after that. So the solution was to delete the top 48, reimport and then go on till all the users had been imported. Problem solved for now but surely is not the ideal.

And strangely, when I re-exported the users back from the fresh install of OJS -- all entries failed xml validation.

Two types of errors:

a) Attribute "locale" must be declared for element type "affiliation".

Code: Select all

...untry><affiliation locale="en_US">University of Johannesburg</affiliation

b) Content of element type "user" must match "(username?,password?,salutation?,first_name,middle_name?,last_name,initials?,gender?,affiliation?,signature?,email,url?,phone?,fax?,mailing_address?,country?,interests*,biography*,locales?,role*)".

Code: Select all

...ature><role type="reader"/></user><user><username>********</username><pa

The file which was used to import the same data into OJS is valid.

Anyone know why this might be occurring?

Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Import error

Postby asmecher » Mon Oct 07, 2013 11:43 am

Hi makemywish,

The XML format has evolved over the years, particularly as elements added support for multilingual content. I suspect you'll find that the exports validate against the native.dtd descriptor for that specific version, but not necessarily against the new install you're importing into. Make sure the document validates against the DTD for the target version before you import it.

Alec Smecher
Public Knowledge Project Team

Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 3 guests