# Migrate Your Way to Drupal 8 Greatness

# Migrate Your Way
to Drupal 8 Greatness

## Bring in content from older Drupal sites, other databases, or HTML files

#### etherpad.net/p/d8migrate

#### @mlncn
agaric.com

    drush migrate-upgrade --legacy-root=http://data.agaric.com --configure-only

      drush mr --all

George Pankewytch, 16 Months after Sandy
Wil Carraway, Pile of Junk

`1 * #Entities
+ 2 * #Fields
= Migration Complexity`

> You're not going to migrate in your schema that you had in Drupal 7 or 6 or Joomla...

disco insolence, Solvognen’s Tangle Of Wires

> ...you'll build it exactly as you want it in Drupal 8.Les Lim

> Migrate module is using a more general process called extract, transform, and load, or ETL.Brad Lowry

> Migration is an Extract, Transform, Load (ETL) process. For historical reasons, in the Drupal migration tool the extract phase is called "source", the transform phase is called "process", and the load phase is called "destination". Migration API

Attrib, ""
In a file `agaric_migrate.info.yml`:

    type: module
    name: Agaric Migrate
    description: "Migrate from Agaric's Drupal 7 site to its new Agaric 8 site."
    package: Migrate
    core: 8.x
    dependencies:
      - migrate
      - migrate_plus

For more complex processing, you can add process plugins.

In a file like `src/Plugin/migrate/process/NerdUserRoles.php`

You start out with:

    namespace Drupal\nerdcustom\Plugin\migrate\process;
    use Drupal\migrate\ProcessPluginBase;
    use Drupal\migrate\MigrateExecutableInterface;
    use Drupal\migrate\Row;

github.com/stevector/nerdologues-d8

    /**
     * This plugin maps old roles to new roles.
     *
     * @MigrateProcessPlugin(
     *   id = "nerd_user_roles"
     * )
     */
    class NerdUserRoles extends ProcessPluginBase {
      /**
       * {@inheritdoc}
       */
      public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
        if ($value == 3) {
          return 'administrator';
        }
        elseif ($value == 4) {
          return 'content_administrator';
        }
      }
    }

earthtimes.org, Loggerhead turtle migration mystery solved

#### etherpad.net/p/d8migrate

#### benjamin melançon

##### ben@agaric.com

##### @mlncn

## Reading & Resources

- drupal.org/docs/8/upgrade/upgrading-from-drupal-6-or-7-to-drupal-8
- Recommended way, with Drush, is in the sub-page of these instructions called Upgrade using Drush (at drupal.org/node/2350651)
- All the options - automatic, mixed, and manual: github.com/kafeiinteractif/shotgun-migrate-tour
- dspeak.com/fldc14/migrate.html (has most background of migrate-in-D8 effort, probably view as historical document)
- From a non-Drupal database www.jeffgeerling.com/blog/2016/migrating-20000-images-audio-clips-and-video-clips-drupal-8 (even though the example is from Drupal, it's really about the non-upgrade approach)Non-Drupal database
- https://www.chapterthree.com/blog/drupal-to-drupal-8-via-migrate-api

## .

IndyDina, ""

Cory Doctorow, "The coming civil war over general purpose computing"

##