I have to add to one of the content types the possibility that when NODE_TYPE_1 is saved, if field_1 (type number or string) has the value of something specific, when saving NODE_TYPE_1, NODE_TYPE_2 has to be added, created with the value of field_1 passed to one of the fields of NODE_TYPE_2.
Any idea what to use, a controller?, the hook_entity_insert? another hook?
I need to copy some entities from one D9-database to different D9-database.
Both databases are full d9-databases - almost identical - but some nodes and users are present in one, which I need to copy to the other.
In Drupal 7 it was fairly simple. With both databases present in settings.php - let's say they were 'default' and 'second_db' - I could then do something along these lines:
<?php
// Switch to second database
db_set_active('second_db');