diff --git a/d7/plugins/sources/entity.inc b/d7/plugins/sources/entity.inc
new file mode 100644
index 0000000..722e8e8
--- /dev/null
+++ b/d7/plugins/sources/entity.inc
@@ -0,0 +1,260 @@
+<?php
+
+/**
+ * @file
+ * Define a MigrateSource for importing from Drupal entities.
+ *
+ * Based on https://www.drupal.org/node/1883112
+ */
+
+/**
+ * Implementation of MigrateSource, to handle imports from Drupal entities.
+ */
+class MigrateSourceEntity extends MigrateSource {
+
+  /**
+   * Source database identifier.
+   *
+   * @var string
+   */
+  protected $sourceConnection;
+
+  /**
+   * Whether the returned records should be wrapped entities rather than the
+   * entities themselves.
+   *
+   * Wrapping entities is useful when migrating from one entity type to another.
+   * When processing an entity type and saving entities back again, not wrapping
+   * may be more desirable.
+   *
+   * @var boolean
+   */
+  protected $wrapEntity = FALSE;
+
+  /**
+   * An array of field names to copy to the wrapper class.
+   */
+  protected $sourceFields = array();
+
+
+  /**
+   * Various fields used below
+   */
+  protected $entityType;
+  protected $entityBundles;
+  protected $countQuery;
+  protected $fields;
+  protected $query;
+  protected $originalQuery;
+  protected $result;
+
+  /**
+   * Simple initialization.
+   *
+   * @param string $sourceDatabaseId
+   *  Identifier of source database
+   * @param EntityFieldQuery $entity_field_query
+   *  The query we are iterating over. An un-executed EntityFieldQuery object.
+   * @param array $fields
+   *  Optional - keys are field names, values are descriptions. Use to override
+   *  the default descriptions, or to add additional source fields which the
+   *  migration will add via other means (e.g., prepareRow()).
+   * @param \EntityFieldQuery|\SelectQueryInterface $count_query
+   *  Optional - an explicit count query, primarily used when counting the
+   *  primary query is slow.
+   * @param array|bool $options
+   *  Options applied to this source:
+   *    - 'wrap_entity': If set and TRUE, the returned record is not the entity
+   *       but a StdClass object with the properties:
+   *       - 'source': the source entity itself.
+   *       - 'id': The entity ID, which can be used for mapping.
+   *       - any further properties specified by the 'source_fields' option.
+   *    - 'source_fields': If using 'wrap_entity', this can be set to an array
+   *       of properties which should be copied from the source entity to the
+   *       wrapper object. This saves the migration class the trouble of doing
+   *       this in prepareRow().
+   */
+  public function __construct($sourceDatabaseId, EntityFieldQuery $entity_field_query, array $fields = array(),
+                              EntityFieldQuery $count_query = NULL, array $options = array()) {
+    $this->sourceConnection = $sourceDatabaseId;
+
+    parent::__construct($options);
+
+    $this->originalQuery = $entity_field_query;
+    $this->query = clone $entity_field_query;
+
+    $this->fields = $fields;
+    if (is_null($count_query)) {
+      // Make a count query based on the given EntityFieldQuery.
+      $count_query = clone $entity_field_query;
+      $count_query->count();
+      $this->countQuery = $count_query;
+    }
+    else {
+      $this->countQuery = $count_query;
+    }
+
+    // Extract the entity type and bundle(s) (if any set) from the query.
+    $this->entityType = $entity_field_query->entityConditions['entity_type']['value'];
+
+    db_set_active($sourceDatabaseId);
+    $entity_info = entity_get_info($this->entityType);
+    db_set_active();
+
+    if (isset($entity_field_query->entityConditions['bundle']['value'])) {
+      // If the EntityFieldQuery has a bundle condition, that determines the
+      // list of bundles we work with.
+      if (is_array($entity_field_query->entityConditions['bundle']['value'])) {
+        // If the EntityFieldQuery has an array of several bundles in its bundle
+        // condition, our list of bundles is just the value arrray.
+        $this->entityBundles = $entity_field_query->entityConditions['bundle']['value'];
+      }
+      else {
+        // If the EntityFieldQuery has a single bundle, convert it to an array.
+        $this->entityBundles = array($entity_field_query->entityConditions['bundle']['value']);
+      }
+    }
+    elseif (count($entity_info['bundles']) == 1) {
+      // Special case, DX sugar: if the EntityFieldQuery has no bundle condition
+      // AND there is only one bundle, we consider that to be implicitly set.
+      $bundles = array_keys($entity_info['bundles']);
+      $this->entityBundles = array(reset($bundles));
+    }
+    else {
+      $this->entityBundles = array();
+    }
+
+    // Set our options.
+    if (!empty($options['wrap_entity'])) {
+      $this->wrapEntity = TRUE;
+    }
+    if (!empty($options['source_fields'])) {
+      $this->sourceFields = $options['source_fields'];
+    }
+
+  }
+
+  /**
+   * Return a string representing the source query.
+   *
+   * @return string
+   */
+  public function __toString() {
+    return "Entity Field Query: $this->entityType";
+  }
+
+  /**
+   * Returns a list of fields available to be mapped from the source query.
+   *
+   * @return array
+   *  Keys: machine names of the fields (to be passed to addFieldMapping)
+   *  Values: Human-friendly descriptions of the fields.
+   */
+  public function fields() {
+    $fields = array();
+
+    db_set_active($this->sourceConnection);
+
+    $property_info = entity_get_property_info($this->entityType);
+    foreach ($property_info['properties'] as $property_name => $property_definition) {
+      $fields[$property_name] = $property_definition['label'];
+    }
+    foreach ($this->entityBundles as $bundle_name) {
+      foreach ($property_info['bundles'][$bundle_name]['properties'] as $property_name => $property_definition) {
+        $fields[$property_name] = $property_definition['label'];
+      }
+    }
+
+    // Any caller-specified fields with the same names as extracted fields will
+    // override them; any others will be added
+    if ($this->fields) {
+      $fields = $this->fields + $fields;
+    }
+
+    db_set_active();
+
+    return $fields;
+  }
+
+  /**
+   * Return a count of all available source records.
+   */
+  public function computeCount() {
+    db_set_active($this->sourceConnection);
+
+    $count = $this->countQuery->execute();
+
+    db_set_active();
+
+    return $count;
+  }
+
+  /**
+   * Implementation of MigrateSource::performRewind().
+   */
+  public function performRewind() {
+    $this->result = NULL;
+    $this->query = clone $this->originalQuery;
+
+    db_set_active($this->sourceConnection);
+
+    migrate_instrument_start('MigrateSourceEntity execute');
+    $result = $this->query->execute();
+    migrate_instrument_stop('MigrateSourceEntity execute');
+
+    db_set_active();
+
+    if (isset($result[$this->entityType])) {
+      $this->result = $result[$this->entityType];
+    }
+    else {
+      $this->result = array();
+    }
+
+    reset($this->result);
+  }
+
+
+  /**
+   * Implementation of MigrateSource::getNextRow().
+   *
+   * @return object|boolean
+   */
+  public function getNextRow() {
+    $entity_stub = current($this->result);
+    next($this->result);
+
+    if (!empty($entity_stub)) {
+      db_set_active($this->sourceConnection);
+      list($id) = entity_extract_ids($this->entityType, $entity_stub);
+      $entity = entity_load_single($this->entityType, $id);
+      db_set_active();
+
+      // Return either the entity itself (which can cause problems elsewhere in
+      // Migrate if it's a classed entity, as parts of Migrate expect result
+      // rows to be StdClass), or a StdClass object which has the entity as a
+      // property.
+      if ($this->wrapEntity) {
+        $record = new StdClass;
+        $record->source = $entity;
+
+        // We also have to set the entity ID on the record for mapping.
+        $record->id = $id;
+
+        // Copy any source fields that have been specified in the options.
+        foreach ($this->sourceFields as $field_name) {
+          $record->{$field_name} = $entity->{$field_name};
+        }
+
+        return $record;
+      }
+      else {
+        return $entity;
+      }
+    }
+    else {
+      return FALSE;
+    }
+  }
+
+}
diff --git a/migrate_d2d.info b/migrate_d2d.info
index 5b11a35..1eb133b 100644
--- a/migrate_d2d.info
+++ b/migrate_d2d.info
@@ -43,6 +43,9 @@ files[] = d6/role.inc
 files[] = d6/taxonomy.inc
 files[] = d6/user.inc
 
+; D7 plugins
+files[] = d7/plugins/sources/entity.inc
+
 ; D7 implementations
 files[] = d7/d7.inc
 ;files[] = d7/block_custom.inc
