---
url: 'https://metadrop.net/es/articulos/ejecutar-importacion-migrate-programaticamente'
title: 'Ejecutar importación de migrate programáticamente'
author: 'Jorge Tutor'
date: '2017-01-17T09:58:53+00:00'
updated: '2020-05-20T12:42:55+00:00'
type: article
summary: 'Snippet para realizar una importación de migrate.'
tags:
  - 'Migrate API (Drupal module)'
image: 'https://metadrop.net/modules/custom/metadrop_schema/images/metadropnet-social.jpg'
published: true
og:
  site_name: Metadrop
  'image:type': image/jpeg
  'image:width': '1200'
  'image:height': '630'
  'image:alt': Metadrop
  locale: es_ES
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      '@type': Article
      '@id': 'https://metadrop.net/es/articulos/ejecutar-importacion-migrate-programaticamente#article'
      name: 'Ejecutar importación de migrate programáticamente'
      headline: 'Ejecutar importación de migrate programáticamente'
      description: 'Snippet para realizar una importación de migrate.'
      about: 'Migrate API (módulo de Drupal)'
      image:
        '@type': ImageObject
        url: 'https://metadrop.net/modules/custom/metadrop_schema/images/metadropnet-social.jpg'
        width: '1200'
        height: '630'
      datePublished: '2015-01-12T08:00:00+0100'
      dateModified: '2020-05-20T14:42:55+0200'
      author:
        '@type': Person
        name: 'Jorge Tutor'
      publisher:
        '@type': Organization
        '@id': 'https://metadrop.net/#organization'
      mainEntityOfPage: 'https://metadrop.net/es/articulos/ejecutar-importacion-migrate-programaticamente'
    -
      '@type': Organization
      '@id': 'https://metadrop.net/#organization'
      url: 'https://metadrop.net/'
      name: Metadrop
      sameAs:
        - 'https://www.drupal.org/metadrop'
        - 'https://x.com/metadrop'
        - 'https://asociaciondrupal.es/partner/metadrop'
        - 'https://www.linkedin.com/company/metadrop'
      telephone: '+34910053180'
      contactPoint:
        '@type': ContactPoint
        telephone: '+34910053180'
        email: hola@metadrop.net
        availableLanguage:
          - Spanish
          - English
        contactType: 'customer service'
      logo:
        '@type': ImageObject
        url: 'https://metadrop.net/modules/custom/metadrop_schema/images/logo-metadrop-500-500.jpg'
        width: '500'
        height: '500'
      address:
        '@type': PostalAddress
        streetAddress: 'Calle Virgen de Nuria 23'
        addressLocality: Madrid
        addressRegion: Madrid
        postalCode: '28027'
        addressCountry: ES
    -
      '@type': ItemPage
      '@id': 'https://metadrop.net/es/articulos/ejecutar-importacion-migrate-programaticamente'
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: Inicio
            item: 'https://metadrop.net/es'
          -
            '@type': ListItem
            position: 2
            name: 'Artículos expertos sobre Drupal y tecnología'
            item: 'https://metadrop.net/es/articulos'
      publisher:
        '@type': Organization
        '@id': 'https://metadrop.net/#organization'
---
 1. [Artículos](https://metadrop.net/es/articulos)
 
  

# Ejecutar importación de migrate programáticamente

Lunes 12 de Enero de 2015

 

 



Snippet para realizar una importación de migrate.



   



En ocasiones puede ser útil la importación de un elemento de migrate en PHP


```php
$options = array(
  'limit' => 1,
  'idlist' => $list,
);
migrate_static_registration(array($machine_name));
$migration = Migration::getInstance($machine_name);
$result = $migration->processImport($options);
```



[Migrate API (módulo de Drupal)](https://metadrop.net/es/articulos?text=Migrate%20API%20%28m%C3%B3dulo%20de%20Drupal%29)

 

- Jorge Tutor
    
    CIO