Exporting an entire node with references:
drush default-content-export-references node 2 --folder=modules/custom/my_content/content
.. I guess is exporting too much.
It is exporting users too, which is not my need, but I can understand it is needed for people. But at least uid 0 should not be exported.
The I get this on next importation :
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' in [error]
/home/philax/mazarine/thalassa-website/project/www/thalassa/core/lib/Drupal/Core/Database/Statement.php:59| Comment | File | Size | Author |
|---|---|---|---|
| #7 | update_existing_entitites_with_revisions_2763019_7.patch | 2.8 KB | codium |
| #6 | update_existing_entitites_with_revisions_2763019_6.patch | 2.84 KB | codium |
| #4 | update_existing_entitites_2763019_4.patch | 875 bytes | codium |
| #2 | export_references_exports_too_much-2763019-2.patch | 778 bytes | pguillard |
Comments
Comment #2
pguillard commentedComment #3
pguillard commentedComment #4
codium commentedI've added other solution. Detect existing entities upon import.
Comment #5
dermarioThe patch in #4 makes totally sense to me.
Comment #6
codium commentedThanks for feedback @dermario
Added new version of a patch.
It solves: https://www.drupal.org/node/2837125 and related (other entity types like paragraph).
Also exported users are blocked by default. It's major pain in the ass in case of uid=1. After import by a custom drush command superadmin was always blocked. More info: https://www.drupal.org/node/2625846#comment-11832206Comment #7
codium commentedCombined two patches into one
Comment #8
codium commentedIt seems that patch from https://www.drupal.org/node/2640734#comment-11793662 solves all the issues describe here