# Acquia DAM Bulk Asset Import

Provides bulk asset import functionality for Acquia DAM integration.

## Documentation

For detailed information on using the Bulk Import feature, please refer to:
https://community.acquia.com/acquiadam/s/article/How-do-I-use-the-Bulk-Import-feature

## Drush Commands

Three commands are available for bulk asset import:

```sh
# Queue all assets based on saved configuration
drush acquia-dam:queue-import-assets
drush ad-qia  # Short alias

# Process the queued assets
drush acquia-dam:process-import-queue --batch-size=10 --limit=0
drush ad-piq  # Short alias

# Queue and process in one command (recommended)
drush acquia-dam:import-assets --batch-size=10 --limit=0
drush ad-ia  # Short alias
```

**Options:**
- `--batch-size`: Items to process per batch (default: 10)
- `--limit`: Maximum items to process (default: 0 = unlimited)

## Migration from Contributed Module

If migrating from the contributed `drupal/acquiadam_asset_import` module:

### Steps

1. **Remove the contributed module** (do NOT uninstall from Drupal UI first):
   ```sh
   composer remove drupal/acquiadam_asset_import
   ```

2. **Run database updates** to migrate configuration:
   ```sh
   drush updb -y
   ```

3. **Clear cache:**
   ```sh
   drush cr
   ```

### Requirements

- Site must be authenticated with Acquia DAM before running updates
- If update fails with "unauthenticated" error, authenticate first then re-run `drush updb -y`

### What Gets Migrated

The update hooks automatically migrate:
- Category configurations from old module
- Converts to new format with subcategory support
- Cleans up old queue (`dam_worker`)
- Creates new queue (`acquia_dam_asset_import`)

Check logs after migration: `drush watchdog:show --type=acquia_dam`
