# Copy the contrib migrate_upgrade module to core drupal_upgrade. echo 'Copy the contrib migrate_upgrade module to core drupal_upgrade.' cp -R modules/contrib/migrate_upgrade core/modules mv core/modules/migrate_upgrade core/modules/drupal_upgrade pushd core/modules/drupal_upgrade # Remove drush-only files, and git. echo 'Remove drush-only files, and git.' rm migrate_upgrade.drush.inc rm src/MigrateUpgradeDrushRunner.php rm src/DrushLogMigrateMessage.php rm -Rf .git # Rename the files. echo 'Rename the files.' for f in migrate_upgrade.*; do mv "$f" "`echo $f | sed s/migrate_upgrade/drupal_upgrade/`"; done # Put the shared trait into migrate_drupal. echo 'Put the shared trait into migrate_drupal.' mv src/MigrationCreationTrait.php ../migrate_drupal/src # Replace module name references (namespaces etc.) in all drupal_upgrade files. echo 'Replace module name references (namespaces etc.) in all drupal_upgrade files.' find . -name "?*.*" -exec sed -i.bak 's/migrate_upgrade/drupal_upgrade/g' {} \; # Fix up the trait. echo 'Fix up the trait.' sed -i.bak s/migrate_upgrade/migrate_drupal/g ../migrate_drupal/src/MigrationCreationTrait.php # and references to the trait echo ' and references to the trait' find . -name "?*.*" -exec sed -i.bak 's/drupal_upgrade\\MigrationCreationTrait/migrate_drupal\\MigrationCreationTrait/g' {} \; # Cleanup. echo 'Cleanup' find . -name "*.bak" -delete find ../migrate_drupal -name "*.bak" -delete # Return home. popd