WordPress Importer: process stop and stuck on a certain post number
-
February 1, 2023 at 11:57 am #9215[anonymous]
Hi,
I plan to migrate some sites (more than one) from WordPress to Publii. This happens when I try to import, like:
website A –> always stop and stuck on post #38
website B –> always stop and stuck on post #16
website C –> always stop and stuck on post #210
etc…see the attachmentAt first, I think it is because I do some find and replace (for image styling) mistakes that make the XML file broken. But, when I try again without any “find and replace” the problem still happens exactly on that post number. I also already try this:
– deactivate all plugins and set the permalink to a plain number (not postname permalink) before making an export file. still not solved.Please help. Is there any other clue/things that I should check to solve this?
Best Regards,
February 1, 2023 at 10:20 pm #9219[anonymous]Import-error log:
C:\Users\DELL\AppData\Local\Programs\Publii\resources\app.asar\back-end\post.js:495
sqlQuery.run({
^
SqliteError: UNIQUE constraint failed: posts_tags.tag_id, posts_tags.post_id
at Post.saveTag (C:\Users\DELL\AppData\Local\Programs\Publii\resources\app.asar\back-end\post.js:495:18)
at Post.saveTags (C:\Users\DELL\AppData\Local\Programs\Publii\resources\app.asar\back-end\post.js:466:22)
at Post.save (C:\Users\DELL\AppData\Local\Programs\Publii\resources\app.asar\back-end\post.js:249:14)
at WxrParser.importPostsData (C:\Users\DELL\AppData\Local\Programs\Publii\resources\app.asar\back-end\modules\import\wxr-parser.js:434:41)
at Import.importFile (C:\Users\DELL\AppData\Local\Programs\Publii\resources\app.asar\back-end\modules\import\import.js:93:21)
at process.<anonymous> (C:\Users\DELL\AppData\Local\Programs\Publii\resources\app.asar\back-end\workers\import\import.js:14:18)
at process.emit (node:events:526:28)
at emit (node:internal/child_process:938:14)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
code: ‘SQLITE_CONSTRAINT_PRIMARYKEY’
}February 2, 2023 at 5:55 pm #9227[anonymous]Have tried these before making WP export file, but still not solved with exact same problem:
- Deactivate and delete all WP plugins.
- Use the default WordPress theme.
- Delete all tags.
- Set permalink to plain, not postname.
This problem is weird and looks inconsistent. I have tried to export 14 websites, and 4 of them are successful, but 10 have exact same problem: the import process stops and stuck on a certain post number.
February 2, 2023 at 9:35 pm #9230[anonymous]Hi,
According to the error it seems that for some reasons you have some duplicated tags for the same posts. In fact such situation is not correct, but for me it is hard to say how it is possible.
Could you attach some example of the problematic WXR file as a private reply?
February 3, 2023 at 12:49 am #9238[anonymous]This reply has been marked as private.February 3, 2023 at 1:58 pm #9252[anonymous]Thank you for the WXR file – I will try to check this problem over the weekend 🙂
February 5, 2023 at 1:45 pm #9260[anonymous]Hi,
Thx a lot and respect your response to checking this problem. Fortunately, I have found the solution. Problem solved.
I don’t know the real problem, because I don’t know the real logic/code behind the wp importer plugin. But, here are what I do, hope this can help other with the same problem or the developer of the plugin:
- Look for the post title where the import process stops. If the process stops at post #38, find post #39 (this is the problematic post that makes the import process stop), then see the post category. In my case, I have found two possible causes:
- Somehow I have two CHILD categories with the same exact name on that post (eg. cooking, cooking). Solution: I uncheck one category from the post and then delete that one category sitewide.
- But, the problem does not stop there, I also find that problematic posts have “similar” PARENT and CHILD category names. This post is also problematic. This is exactly what I have, a post with title: “bla bla bla”, parent category: “Cooking, Food & Recipes”, and child category: “Cooking”. Solution: I uncheck the post parent category, and check the child category only.
That’s it.
Best regards,
February 5, 2023 at 9:21 pm #9262[anonymous]Hi kinjgr,
Thank you for your update. It seems that it will require bigger update of the WP Importer – I will try to do it next week to solve such issues in Publii v.0.42 🙂
February 11, 2023 at 2:10 pm #9326[anonymous]Hi kinjgr,
The issue was in fact even bigger, because due invalid implementation WXR was failed when you have comma in the category/tag name and it covers with existing tag. In fact we had protection to avoid double tag assignment.
Also I have fixed issue when by naming tag “test1,test2”, you got in fact two tags 🙂
Everything will be fixed in Publii v.0.42