You might be getting several messages like this when you try to uninstall and reinstall a migration module:
exception 'Drupal\Core\Config\PreExistingConfigException' with message 'Configuration objects (migrate_plus.migration.article) provided by migrate_MODULE_NAME already exist in active configuration' in /var/www/public/example.com/drupal/core/lib/Drupal/Core/Config/PreExistingConfigException.php:65
One way of solving it is through the console:
drush php;
Drupal::configFactory()->getEditable('migrate_plus.migration.migrate_article')->delete();
Drupal::configFactory()->getEditable('migrate_plus.migration.migrate_page')->delete();
Drupal::configFactory()->getEditable('migrate_plus.migration.migrate_another_content_type')->delete();
exit;
But adding an install file to your migration module, will take care of any lingering migrate configurations, and delete them on uninstall:
/**
* @file
* Contains MODULE_NAME.install.
*/
/**
* Implements hook_uninstall().
*
* Removes stale migration configs during uninstall.
*/
function MODULE_NAME_uninstall() {
$database = \Drupal::database();
$query = $database->select('config', 'c')
->fields('c', array('name'))
->condition('name', $database->escapeLike('migrate_plus.') . '%', 'LIKE')
->execute();
$config_names = $query->fetchAll();
// Delete each config using configFactory.
foreach ($config_names as $config_name) {
\Drupal::configFactory()->getEditable($config_name->name)->delete();
}
}
Original .install file found at Is there a way with drush or console to delete all active config with a certain prefix?