Абраменко Иван выступил с темой “Migrate drupal 6 to drupal 8” на Drupal Cafe #18
Видео с выступления вы можете увидеть, перейдя по ссылке https://youtu.be/kC5U7PKHu7c?list=PLtUZRIj1OWYzCGb3OCYMVYqnrJ-EpH0Ot
4. Drupal 8.1.x migration
Migrate UI didn't work for Drupal 8.1.x and above
https://www.drupal.org/project/migrate_ui
Migrations are core are now plugins, not con g entities.
https://www.drupal.org/node/2677198
https://www.drupal.org/node/2625696
Try to use Migrate Drupal UI core module for Drupal 8.2.x
and above.
17. UI doesn't work as you want
https://www.drupal.org/node/2708967
18. UI doesn't work as you want
https://www.drupal.org/node/2708967
migrate.migration.d6_node_type.yml
...
process:
type:
plugin: static_map
source: type
map:
blog_entry: blog
...
31. Single value fields:
$row>setSourceProperty('body_value', $record>body);
Multiple values fields:
// Multiple fields.
$result = $this>getDatabase()>query('
SELECT
*
FROM
{content_field_related_resources} r
INNER JOIN {node} node ON r.vid = node.vid
WHERE
r.nid = :nid
', array(':nid' => $nid));
$related_resources = [];
foreach ($result as $record) {
if (!empty($record>field_related_resources_nid)) {
$related_resources[] = $record>field_related_resources_nid;
}
}
$row>setSourceProperty('field_related_resources', $related_resources);
32. And few methods to describe entity:
public function getIds() {
$ids['nid']['type'] = 'integer';
$ids['nid']['alias'] = 'n';
return $ids;
}
public function bundleMigrationRequired() {
return FALSE;
}
public function entityTypeId() {
return 'node';
}
33. Process — map between
destination => source
process:
nid: nid
vid: vid
type: type
langcode:
plugin: static_map
bypass: true
source: language
map:
und: en
en: en
title: title
uid: uid
status: status
created: created
changed: changed
promote: promote
34. We decided to use old nid/vid values:
process:
nid: nid
vid: vid
Be sure you deleted all content before
migration!
35. Use batch API for any problems after
migration
Nodewords, Page Title:
https://www.drupal.org/node/2052441
https://www.drupal.org/node/2563649
36. Thank you! And successful migrations!
Migration from Drupal 6 to Drupal 8
My first Drupal 8 migration
Created by / Drupal developerIvan Abramenko CimpleO
levmyshkin89@gmail.com