Problem/Motivation

As a site administrator, I want to open the migration wizard and run the migration in batches, so that large media libraries migrate with progress reporting, dedup, and correct post-processing (field-data copy, view-display fixes, validation).

Acceptance Criteria:

Queue service (MigrationQueueService):

  • getQueue() — returns the acquia_dam_media_migration queue
  • queueMediaForMigration() — per-type; skips types not included, types without a target media type, already-migrated media (asset-id table), and already-queued media (dedup table); inserts into acquia_dam_migration_queue_map
  • getQueueStatus(), clearQueue(), resetMigrationState(), getManagedFieldName(), getMigratedMediaIds() / isMediaMigrated(), performMediaTypeOperations()
  • Constructor: @queue, @state, @entity_type.manager, @database, @config.factory, utility service
  • Dedup tracking table acquia_dam_migration_queue_map (media_id PK) replaces the full-queue unserialize scan (memory-safe at 50K+)

Batch engine:

  • Batch/QueueProcessBatch.php — thin static wrapper exposing QueueProcessBatchService to the batch API
  • QueueProcessBatchService (DI-injected) — process() claims items, delegates to the queue worker plugin, deletes on success / re-queues on failure, tracks progress in the sandbox; failure re-queued with retry_count, dropped with a log after max 3 attempts
  • finish() — copyAssetDataFromOldToNewTable(), validateMigrationCompletion(), updateViewDisplays(), sets acquia_dam.migration_process_finished
  • copyAssetDataFromOldToNewTable() — dynamic table mapping via SqlContentEntityStorage::getTableMapping(); copies core field data (target_id, alt, title, display, description, width, height) into DAM managed tables, batched (1000/batch), transactional
  • updateViewDisplays() — per target bundle: hides unused DAM field, shows correct managed field, applies acquia_dam_embed_code embed formatter (+ embed_style for images)
  • getMediaCounts(), getMediaCountsPostMigration(), validateMigrationCompletion(), populateMigratedDataState() helpers

Controller (MigrationController):

  • openMigrationForm() — routes to the wizard (AcquiaDamMigration) or the completion page (AcquiaDamMigrationComplete) based on the acquia_dam.migration_process_finished state; title() callback; completePage()
  • Injects State, FormBuilder, RouteMatch, AcquiaDamMigrationUtilityService

Scaffold (structure layer):

  • acquia_dam_migration_tools.routing.yml ← new — route acquia_dam_migration_tools.configuration (/admin/config/acquia-dam/migration, POST), _controller: MigrationController::openMigrationForm, _title_callback: MigrationController::title, _permission: administer acquia_dam + _custom_access: AuthenticationController::checkAccess
  • acquia_dam_migration_tools.permissions.yml ← new — administer acquia_dam_migration_tools (restrict access)
  • acquia_dam_migration_tools.links.menu.yml ← new (parent: acquia_dam.config) + acquia_dam_migration_tools.links.task.yml ← new (base_route: acquia_dam.config)
  • acquia_dam_migration_tools.services.yml ← updated — queue + batch service registrations

Tests:

  • QueueProcessBatchTest (kernel) — getMediaCounts empty/correct/multi-bundle/bundle-with-no-media; validateMigrationCompletion empty/no-include; getMediaCountsPostMigration empty/empty-bundles
  • MigrationQueueServiceTest (kernel) — getQueue; queues items; skips not-included types; skips types without target media type; empty stored values; clearQueue; getQueueStatus; resetMigrationState
  • MigrationControllerTest (kernel) ← new coverage — wizard vs completion-page routing based on migration_process_finished

Issue fork acquia_dam-3618306

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajeshreeputra created an issue. See original summary.

rajeshreeputra’s picture

Title: Create batch, Controller and MetadataMapper service » Create batch, Controller and MigrationQueueService service
Status: Active » Needs work
rajeshreeputra’s picture

Title: Create batch, Controller and MigrationQueueService service » Create queue process batch, queue service and route controller
rajeshreeputra’s picture

Assigned: rajeshreeputra » Unassigned
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rajeshreeputra’s picture

Status: Fixed » Needs review

  • rajeshreeputra committed db9dc581 on migration-tools
    Resolve #3618306 "Create queue process batch, queue service and route...
rajeshreeputra’s picture

Status: Needs review » Fixed

MR merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • rajeshreeputra committed 9a3435f9 on migration-tools
    Resolve #3618306 "Create queue process batch, queue service and route...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.