OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



xml import problems

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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

xml import problems

Postby kellner » Mon Jan 19, 2009 2:14 pm

I had imported an xml file of issues into OJS, without galleys. Now I wanted to add galleys (PDFS retrieved through an URL), modified the xml file and thought I could just delete all the earlier issue data and reimport.

I went into phpmyadmin and emptied all the article_* and issue tables, then tried to reimport - both through the interface and from the command-line.

Both methods produce an error message:

DB Error: Duplicate entry '2-1' for key 1

In the tables, I see that the first two issues are imported, with articles, but then the process doesn't continue. I suspect the error means that, well, some table is not as empty as the import tool excepts it to be, but couldn't find out which table causes the problem.

Any advice would be greatly appreciated,

thanks,
kellner
 
Posts: 39
Joined: Fri Apr 07, 2006 12:11 pm

Re: xml import problems

Postby mcrider » Tue Jan 20, 2009 11:16 am

Hi kellner,

You might be able to just go in as editor and delete the partially imported submissions and issues. Otherwise, could you go into your config.inc.php file and set "show_stacktrace" to 'On', and this should help us track down what table is having the problem?

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: xml import problems

Postby kellner » Tue Jan 20, 2009 12:03 pm

Thanks - the stack trace really helped.

It turns out that the problem was an issue where an article of section 2 was placed in between several articles of section 1 - this seems to be a situation that ojs cannot cope with (in table custom_section_orders). Once this article was relocated, the import worked fine.

In case anyone else arrives in the same situation - this is the chain of sql commands I used to empty all the tables:

TRUNCATE `articles` ;
TRUNCATE `article_authors` ;
TRUNCATE `article_author_settings` ;
TRUNCATE `article_comments` ;
TRUNCATE `article_email_log` ;
TRUNCATE `article_event_log` ;
TRUNCATE `article_files` ;
TRUNCATE `article_galleys` ;
TRUNCATE `article_html_galley_images` ;
TRUNCATE `article_notes` ;
TRUNCATE `article_search_keyword_list` ;
TRUNCATE `article_search_objects` ;
TRUNCATE `temporary_files`;
TRUNCATE `article_search_object_keywords` ;
TRUNCATE `article_settings` ;
TRUNCATE `article_supplementary_files` ;
TRUNCATE `article_supp_file_settings` ;
TRUNCATE `article_xml_galleys` ;
TRUNCATE `copyed_assignments` ;
TRUNCATE `custom_section_orders` ;
TRUNCATE `issues`;
TRUNCATE `issue_settings` ;
TRUNCATE `layouted_assignments` ;
TRUNCATE `proof_assignments` ;
TRUNCATE `published_articles` ;
TRUNCATE `sections` ;
TRUNCATE `custom_section_orders`;

Note that if galley files have been created in the botched import, you'll also have to remove the files from the "files" directory.
kellner
 
Posts: 39
Joined: Fri Apr 07, 2006 12:11 pm

Re: xml import problems

Postby mcrider » Tue Jan 20, 2009 2:57 pm

Thanks Roland, that should prove useful to others. And me, since I wasn't sure exactly how many tables were involved :)

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: xml import problems

Postby jamilj » Fri Sep 20, 2013 10:14 pm

Hello,

Apparently no one really uses this Import plugin because this problem still has not been fixed. For those wishing to test import scenarios it is a veritable nightmare. This may have worked at some point but at five or so of the tables listed by kellnor no longer exist. I tried to find those missing tables and come up with an updated list. I got this:

Code: Select all
TRUNCATE `articles` ;
TRUNCATE `article_comments` ;
TRUNCATE `article_event_log` ;
TRUNCATE `article_files` ;
TRUNCATE `article_galleys` ;
TRUNCATE `article_galley_settings` ;
TRUNCATE `article_html_galley_images` ;
TRUNCATE `article_search_keyword_list` ;
TRUNCATE `article_search_objects` ;
TRUNCATE `article_search_object_keywords` ;
TRUNCATE `article_settings` ;
TRUNCATE `article_supplementary_files` ;
TRUNCATE `article_supp_file_settings` ;
TRUNCATE `article_xml_galleys` ;
TRUNCATE `authors` ;
TRUNCATE `author_settings` ;
TRUNCATE `custom_section_orders` ;
TRUNCATE `custom_issue_orders` ;
TRUNCATE `issues`;
TRUNCATE `issue_settings` ;
TRUNCATE `published_articles` ;
TRUNCATE `sections` ;
TRUNCATE `temporary_files`;


Alas, I still get the dreaded error: DB Error: Duplicate entry '1-1' for key 'custom_section_orders_pkey'…. It would be wonderful to know how to reset this plugin so I don't have to nuke my database each time I want to test the plugin again.
jamilj
 
Posts: 40
Joined: Sun Aug 25, 2013 10:36 pm

Re: xml import problems

Postby asmecher » Sat Sep 21, 2013 7:39 pm

Hi jamilj,

I've followed up on this thread; please try not to post the same issue in multiple places as it clutters the forum.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8575
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest