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
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pguillard created an issue. See original summary.

pguillard’s picture

pguillard’s picture

Status: Active » Needs review
codium’s picture

I've added other solution. Detect existing entities upon import.

dermario’s picture

The patch in #4 makes totally sense to me.

codium’s picture

Thanks 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-11832206

codium’s picture

Combined two patches into one

codium’s picture

It seems that patch from https://www.drupal.org/node/2640734#comment-11793662 solves all the issues describe here