Entities need to be deleted before importing.

Drupal 10
Drupal 9
Drupal 8
Basic
Deploy error
BBD Custom

Today I'm going to talk about very common deploy issue and solve it :)

Entities exist of type <em class="placeholder">Entity Type</em> and   
  <em class="placeholder">Entity Type Bundle</em>. These entities need to be deleted before importing.  

I've updated bbd_cusom module to have BBDCustomUtilities class and deleteEntitiesByType which will delete content to prevent deploy failure. 

To use it please add update function into bbd_custom.install similar to above:

/**
* Remove entities before entity type removal - paragraphs_type topic_list_builder.
*/
function bbd_custom_update_9008(&$sandbox) {
\Drupal::service('bbd_custom.utilities')->deleteEntitiesByType('paragraph', 'topic_list_builder');
}
 

Where "paragraph" is entity type (node, user etc can be used) and topic_list_builder is entity type bundle.

References