---
title: Drupal 8 Migration Drush commands | Drupal Development Agency | Hire Drupal Developers | Web and mobile app Solutions | Joshi Consultancy Services
description: "Drupal 8 migration is always painful if not planned well. You run into 'Trial-and-error' and end up spending a more time than it is worth.\nHere, there are drush commands which you can use during the migration process. Some of them are from contributed modules which help you during the migration. Drush commands from such modules will be indicated so.\nDrupal 8 migration\nAs we know, migration follows Extract-Transform-Load (ETL) method to migrate the data to Drupal 8.\nHere are the steps:"
---

[Latest Drupal 8 / Drupal 9 tips from Joshi Consultancy Services](https://e.joshics.in/blog)

# [Drupal 8 Migration Drush commands | Drupal Development Agency | Hire Drupal Developers | Web and mobile app Solutions | Joshi Consultancy Services](https://e.joshics.in/blog/drupal-8-migration-drush-commands)

 Written by [Bhavin Joshi](https://e.joshics.in/blog/author/bhavin-joshi) | Sep 16, 2020 11:57:45 AM

Drupal 8 migration is always painful if not planned well. You run into 'Trial-and-error' and end up spending a more time than it is worth.

Here, there are drush commands which you can use during the migration process. Some of them are from contributed modules which help you during the migration. Drush commands from such modules will be indicated so.

## Drupal 8 migration

As we know, migration follows Extract-Transform-Load (ETL) method to migrate the data to Drupal 8.

Here are the steps:

- Extract is Source
- Transform is processing and mapping the data
- Load is setting/copying/saving the data to destination

 

## Drush commands:

`migrate-upgrade`

Connects to the DB where you are migrating from. This command is useful when you are migrating from a Drupal 6 or Drupal 7 website. It takes following full form:

```
drush migrate-upgrade --legacy-db-url=mysql://user:pass@127.0.0.1/d6db --legacy-root=http://myd6site.com 
```

You can also chose to migrate configurations only using

```
--configure-only
```

```
drush migrate-upgrade --legacy-db-url=mysql://user:password@server/db --legacy-root=http://example.com --configure-only 
```

If you your source DB has a prefix in table names, use 

```
--legacy-db-prefix
```

 

`migrate-status`

After creating the migration, this command will give you an overview of the migration that can take place.

 

`migrate-import or mim or mi`

With this command, you actually initiate the migration. You can then selectively import individual or multiple migrations using their names of import them all with

```
--all 
```

 

With [Migrate Manifest](https://www.drupal.org/project/migrate_manifest) module, you can create a group of migration and execute them at once:

```
drush migrate:template:list
```

This command gives you a list of available migration

Migration can be defined in a YAML file as below:

```
# nodes 
- d6_node 
- d6_node_revision 
- d6_node_type 
- d6_view_modes 
- d6_filter_format 
- d6_field_instance_per_form_display 
- d6_field_instance_widget_settings 
- d6_field_formatter_settings 
- d6_field_instance 
- d6_field 
- d6_field_settings 
- d6_node_settings 
- d6_cck_field_values:* 
- d6_cck_field_revision:* 

# taxonomy fields 
- d6_term_node_revision 
- d6_term_node 
- d6_vocabulary_entity_display 
- d6_vocabulary_entity_form_display 
- d6_vocabulary_field_instance 
- d6_vocabulary_field 

# blocks 
- d6_block 
- d6_menu 

# custom blocks 
- d6_custom_block 
- d6_filter_format 

# book 
- d6_book 
- d6_book_settings 

# file migrations are configurable 
- d6_file: 
    source: 
      conf_path: sites/assets 
    destination: 
      source_base_path: destination/base/path 
      destination_path_property: uri 
```

 

Save this file and place it a directory which can be accessed during the migration.  
 

```
drush migrate-manifest --legacy-db-url=mysql://user:pass@localhost/drupal_6 manifest.yml 
```

 

For better control, you can place this YAML file in version control to track the changes.

 

`drush migrate-rollback <migration_id>`

When you have issues with migration or just testing your migration, you can always rollback them!

```
drush mr --group=files
```

 

`migrate-stop`

You can stop an active migration using this command

```
drush migrate-stop <migration_id>
```

 

`migrate-messages`

This command allows you to view messages associated with a migration to debug the process so you can identify the issue and correct it.

```
drush migrate-messages <migration_id>
```

 

`migrate-reset-status`

Reset status of an active migration to idle and start over.

```
drush migrate-reset-status <migration_id>
```

[Need Help?](https://e.joshics.in/contact)

[View full post](https://e.joshics.in/blog/drupal-8-migration-drush-commands)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Bhavin Joshi"
  },
  "dateModified" : "2021-09-16T11:58:41.272Z",
  "datePublished" : "2020-09-16T11:57:45Z",
  "headline" : "Drupal 8 Migration Drush commands",
  "image" : {
    "@type" : "ImageObject",
    "height" : 74,
    "url" : "https://f.hubspotusercontent10.net/hubfs/6752615/Imported_Blog_Media/JOSHI-30072020-filled-background-Sep-16-2021-11-58-28-53-AM.png",
    "width" : 200
  },
  "mainEntityOfPage" : "https://e.joshics.in/blog/drupal-8-migration-drush-commands",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Latest Drupal 8 / Drupal 9 tips from Joshi Consultancy Services"
  }
}
```