There is the problem with import:
Error 1 when imported file "export1.export":
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'uri': INSERT INTO {file_managed} (filesize, status, timestamp, uuid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1314703605 [:db_insert_placeholder_3] => b8e72ead-9837-cfa4-19d0-bcf99caf2727 ) in drupal_write_record() (line 6866 of /home/srv/www/s5.ovia.ru/www/includes/common.inc).
Error 2 when imported file "export2.export":
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'id' cannot be null: INSERT INTO {file_usage} (fid, module, type, id, count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => 4610 [:db_insert_placeholder_1] => file [:db_insert_placeholder_2] => node [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 1 ) in file_usage_add() (line 663 of /home/srv/www/s5.ovia.ru/www/includes/file.inc).
The sites and structure is identical. Second site is the full copy of the first. Drupal 7.7, Node export 7.x-3.x-dev
| Comment | File | Size | Author |
|---|---|---|---|
| export2.export.txt | 19.65 KB | revardy | |
| export1.export.txt | 27.07 KB | revardy |
Comments
Comment #1
danielb commentedCan you explain what 'node import with images' means?
e.g. field api image field with base64 export ?
Comment #2
danielb commentedoh I can work that out from your exports, nevermind
Basically the problem is I ported that code to 7, but it was written by James Andres, and I have difficulty understanding the Drupal 7 file handling changes. So any input/suggestions would be fantastic...
Comment #3
danielb commentedComment #4
James Andres commentedI have had trouble with the same issue actually. I'm considering massively simplifying the node_export_file module now that D7 has the field API. This should help reduce current and future bugs.
Can I get a quick poll from you two (or anyone else interested)?
These are features I reckon should be on the chopping block:
Anyone using these features (why, when inline mode seems to work so well!?)? Any objections?
Comment #5
sirish.ayyagari commentedi am also getting the same error . below is the error
* Unknown error occurred attempting to import file: public://pdf/epa-nanotechnology-whitepaper-0207_1.pdf
* Unknown error occurred attempting to import file: public://images/bar-chart-vertical_1.gif
* PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'uri': INSERT INTO {file_managed} (filesize, status, timestamp, uuid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1316537676 [:db_insert_placeholder_3] => 89a009b3-a0f3-3284-2984-846c93f63b41 ) in drupal_write_record() (line 6868 of /opt/lampstack-3-0-6-0/apps/drupal/htdocs/includes/common.inc).
Comment #6
danielb commentedIf the node_export_file module can be simplified enough that it only integrates with drupal 7+ core file functionality (e.g. fields), perhaps we could roll this functionality into an .inc file, and rather than hooking into node export, node export would actually call the node_export_file* functions as needed?
Had a few issues on here with people not realizing they had to turn an extra module on to make this stuff work.
Comment #7
danielb commentedFYI a very similar error used to appear for D7 export file uploads.
#1192586: file upload error if temp file exists
I managed to fix it, but I don't fully understand it, and I don't think the solution would be appropriate in this case.
Comment #8
crimsondryad commentedDoes anyone have a workaround for this? We're getting ready to migrate a bunch of content from one site to another and if this worked it would really help.
Comment #9
carl.brown commentedIf you export a node that includes a file and you use the inline mode:
it works like a charm. I've tried it with both images and PDFs and it went better than I could have imagined. I guess it all depends how many nodes you're trying to export vs. how big the attached files are, but certainly in my experience there haven't been any problems.
Comment #10
danielb commentedI've removed the modes james andres mentioned in post #4, I think leaving it too long just causes more people to run into this issue, so I thought I'd get it done.
This change is for Drupal 7 only.
It has removed a fair chunk of code but not enough at this stage to roll node_export_file into node_export, perhaps in a future redesign.
Comment #12
kenorb commentedSee as well: #1163740: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 2: INSERT INTO {file_managed}
Comment #13
selvakumar commentedFixed:
In Drupal 7, we have to use file_create_url() instead of url() in node_export.module line no 1052.
Comment #14
RAWDESK commentedIf your files are on public:// , the best option at /admin/config/content/node_export is "Remote file export, URL".
Certainly if you have a lot of nodes and/or large files to migrate.
Comment #15
dsteplight commentedAlso make sure via /admin/config/content/node_export that you have the right content types checked under "File fields" for the content types you are using during your imports for the images that are giving you problems.