Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • project/drupalorg_migrate
  • issue/drupalorg_migrate-3429969
  • issue/drupalorg_migrate-3469272
  • issue/drupalorg_migrate-3470824
  • issue/drupalorg_migrate-3472379
  • issue/drupalorg_migrate-3474989
  • issue/drupalorg_migrate-3477076
  • issue/drupalorg_migrate-3478579
  • issue/drupalorg_migrate-3480220
  • issue/drupalorg_migrate-3480717
  • issue/drupalorg_migrate-3481266
  • issue/drupalorg_migrate-3484748
  • issue/drupalorg_migrate-3485712
  • issue/drupalorg_migrate-3490279
  • issue/drupalorg_migrate-3492285
  • issue/drupalorg_migrate-3499971
  • issue/drupalorg_migrate-3501264
  • issue/drupalorg_migrate-3503380
  • issue/drupalorg_migrate-3504847
  • issue/drupalorg_migrate-3505722
  • issue/drupalorg_migrate-3507553
  • issue/drupalorg_migrate-3509496
  • issue/drupalorg_migrate-3517014
  • issue/drupalorg_migrate-3518595
24 results
Select Git revision
Show changes
Commits on Source (123)
Showing
with 1174 additions and 10 deletions
addressfield
advagg
casestudy
changenotice
devdrupal
devwww
drupalsystems
etid
mainimage
opendocument
tnid
versioncontrol
include:
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'
......@@ -54,7 +54,6 @@ A few taxonomy machine names were renamed:
* `vocabulary_5` to `drupal_version`
* `vocabulary_6` to `core_compatibility`
* `vocabulary_7` to `release_type`
* `vocabulary_9` to `issue_tags`
* `vocabulary_31` to `page_status`
* `vocabulary_34` to `front_page_news`
* `vocabulary_38` to `audience`
......@@ -96,6 +95,104 @@ Migrations to run (included in `<root>/scripts/migrations.sh`:
ddev drush mim FILES
```
## Drupal 7 number of users and nodes per content type (2024-10-21)
```
MariaDB [drupal]> select count(*) from user;
+----------------------+
| count(*) |
+----------------------+
| 2300000+ | ✅ ⚠️ (fields)
+----------------------+
MariaDB [drupal]> select type, count(*) as c from node group by type order by c desc;
+----------------------+---------+
| type | c |
+----------------------+---------+
| project_issue | 1376660 | ℹ️ (GitLab issues)
| forum | 366017 | ✅
| project_release | 236411 | ✅ ⚠️ (fields)
| project_module | 52484 | ✅️️ ⚠️ (fields)
| book | 8621 |
| documentation | 7788 | ✅ ⚠️ (panels)
| changenotice | 6088 | ✅
| organization | 4988 | ✅ ⚠️ (fields)
| project_theme | 3254 | ✅ ⚠️ (fields)
| casestudy | 2950 | ✅
| guide | 1986 | ✅ ⚠️ (panels)
| project_distribution | 1491 | ✅ ⚠️ (fields)
| event | 1046 | ✅
| post | 1020 | ✅ ⚠️ (OG groups)
| page | 627 | ✅ ⚠️ (minus panels)
| sa | 547 | ✅
| project_drupalorg | 275 | ✅ ⚠️ (fields)
| project_general | 149 | ✅ ⚠️ (fields)
| book_listing | 141 | ✅
| project_core | 117 | ✅ ⚠️ (fields)
| project_translation | 99 | ✅ ⚠️ (fields)
| logo | 78 | ✅
| section | 69 |
| contributor_role | 55 | ✅
| contributor_skill | 41 | ✅
| contributor_task | 35 | ✅
| hosting_listing | 33 | ✅
| project_theme_engine | 20 | ✅ ⚠️ (fields)
+----------------------+---------+
```
- *Update 2024-10-21*: `story` nodes were made `post`. `image` nodes will be removed.
## Drupal 7 field_collections that need migrating to paragraphs
The initial migrations were done but needed to be disabled and the data cleaned up.
See the below `Migration issues` section for more details.
Here is the D7 information:
```
select field_name as type, count(*) as count
from field_collection_item
group by type
order by count desc;
+--------------------------------+--------+
| type | count |
+--------------------------------+--------+
| field_release_files | 507539 |
| field_organizations | 370262 |
| field_supporting_organizations | 25191 |
| field_contribution_role | 4678 |
+--------------------------------+--------+
```
## Migration issues
### 2025-01-23 - Wrong references: disable migrations and remove fields.
We had some issues when migrating field collections to paragraphs, where the references would point to the wrong
paragraph type. This was due (we think) to mapping `revision_id: revision_id` but then not have any mapping to keep
the item IDs being the same.
We needed to remove four fields:
- `field_contribution_role` on the `user` entity.
- `field_organizations` on the `user` entity.
- `field_release_files` on the `project_release` entity.
- `field_supporting_organizations` on the `project_module`, `project_theme`, `project_distribution`, `project_drupalorg`, `project_general`, `project_theme_engine` entities.
These fields will need to be recreated, possibly with a new machine name.
We also stopped running the migrations for those field collections to paragraphs and removed them from the
field mappings in the entities migrations.
### 2025-02-06: New fields and new migrations.
Recreate the four new fields like (note the slightly different machine name):
- `field_user_contribution_role` on the `user` entity.
- `field_user_organizations` on the `user` entity.
- `field_project_release_files` on the `project_release` entity.
- `field_project_supporting_org` on the `project_module`, `project_theme`, `project_distribution`, `project_drupalorg`, `project_general`, `project_theme_engine` entities.
### 2025-02-XX: New migrations for the new fields.
@todo - Redo the migrations to point to the new fields.
## Implemented Hacks
......
{
"name": "drupalorg/drupalorg_migrate",
"description": "A custom set of migrations for Drupal.org.",
"type": "drupal-module",
"license": "GPL-2.0+",
"require": {
"drupal/drupalorg": "1.0.x-dev@dev",
"drupal/migrate_plus": "^6.0"
},
"authors": [
{
"name": "Fran Garcia-Linares",
"homepage": "https://www.drupal.org/user/2495842"
},
{
"name": "drumm",
"homepage": "https://www.drupal.org/user/3064"
}
]
}
......@@ -4,8 +4,8 @@ package: DrupalOrg
type: module
core_version_requirement: ^9 || ^10 || ^11
dependencies:
- drupal:link
- drupal:migrate
- drupal:migrate_drupal
- migrate_plus:migrate_plus
- drupalorg:drupalorg
<?php
/**
* @file
* Drupal.org Custom Migrations install hooks.
*/
use Drupal\Core\Database\Database;
/**
* Implements hook_update_N().
*/
function drupalorg_migrate_update_10001() {
drupalorg_migrate_ensure_auto_increment_values();
}
/**
* Implements hook_update_N().
*
* Ensure auto increment values are set.
*/
function drupalorg_migrate_update_10002() {
drupalorg_migrate_ensure_auto_increment_values();
}
/**
* Implements hook_update_N().
*
* Ensure auto increment values are set.
*/
function drupalorg_migrate_update_10003() {
drupalorg_migrate_ensure_auto_increment_values();
}
/**
* Ensure auto increment values.
*/
function drupalorg_migrate_ensure_auto_increment_values() {
$connection = Database::getConnection();
$database = $connection->getConnectionOptions()['database'];
$auto_increment_new_values = [
'node' => 10000000,
'node_revision' => 20000000,
'paragraphs_item' => 2000000,
'paragraphs_item_revision' => 20000000,
'comment' => 30000000,
];
foreach ($auto_increment_new_values as $table => $value) {
$current_value = $connection->query("
SELECT AUTO_INCREMENT
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = '$database' AND TABLE_NAME = '$table'
")->fetchField();
if (is_numeric($current_value) && $current_value < $value) {
$connection->query("ALTER TABLE {" . $table . "} AUTO_INCREMENT = " . $value);
}
}
}
......@@ -13,14 +13,50 @@ function drupalorg_migrate_migration_plugins_alter(array &$migrations) {
// https://drupal.stackexchange.com/questions/316368/how-can-i-disable-the-core-migrations
$migrations = array_filter($migrations, fn(array $m) => $m['provider'] == 'drupalorg_migrate');
// Replace files path per-environment if provided.
$files_migrations = [
'drupalorg_migrate_organization_files',
'drupalorg_migrate_casestudy_upload_media_images',
'drupalorg_migrate_organization_media_images',
'drupalorg_migrate_documentation_media_images',
'drupalorg_migrate_event_cover_photo_files',
'drupalorg_migrate_casestudy_images_files',
'drupalorg_migrate_forum_upload_media_documents',
'drupalorg_migrate_forum_upload_files',
'drupalorg_migrate_casestudy_cover_photo_media',
'drupalorg_migrate_project_files',
'drupalorg_migrate_documentation_files',
'drupalorg_migrate_casestudy_logo_files',
'drupalorg_migrate_casestudy_mainimage_media',
'drupalorg_migrate_event_event_logo_files',
'drupalorg_migrate_blog_post_media_images',
'drupalorg_migrate_guide_media_images',
'drupalorg_migrate_guide_files',
'drupalorg_migrate_casestudy_cover_photo_files',
'drupalorg_migrate_blog_post_files',
'drupalorg_migrate_casestudy_upload_files',
'drupalorg_migrate_event_cover_photo_media',
'drupalorg_migrate_blog_post_media_documents',
'drupalorg_migrate_guide_media_documents',
'drupalorg_migrate_casestudy_upload_media_documents',
'drupalorg_migrate_casestudy_images_media',
'drupalorg_migrate_documentation_media_documents',
'drupalorg_migrate_casestudy_mainimage_files',
'drupalorg_migrate_event_event_logo_media',
'drupalorg_migrate_casestudy_logo_media',
'drupalorg_migrate_forum_upload_media_images',
];
foreach ($migrations as $id => $migration) {
// Files location alter.
if ($id === 'drupalorg_migrate_project_files') {
if (in_array($id, $files_migrations)) {
$paths = \Drupal::config('drupalorg_migrate')->get('project_files') ?? [];
if (!empty($paths['source'])) {
$migrations[$id]['source']['constants']['source_base_path'] = $paths['source'];
}
if (!empty($paths['remote'])) {
$migrations[$id]['remote']['constants']['remote_base_path'] = $paths['remote'];
}
}
}
}
services:
drupalorg_migrate.memory_control_event_handler:
class: Drupal\drupalorg_migrate\EventSubscriber\MemoryControlEventHandler
arguments: ['@config.factory', '@entity.memory_cache']
tags:
- { name: event_subscriber }
langcode: en
status: true
id: drupalorg_migrate_blog_post_files
#migration_tags:
# - 'Drupal 7'
# - Content
migration_group: drupalorg_migrate
label: 'Blog Post Files to Media entities'
source:
plugin: d7_file_blog_post_files
scheme: public
constants:
# Path changed via hook_migration_plugins_alter
# and set via $config['drupalorg_migrate']['project_files']['source']
source_base_path: '/var/www/html/web/files/d7-files'
remote_base_path: 'https://www.drupal.org'
destination:
plugin: entity:file
process:
# If you are using this file to build a custom migration consider removing
# the fid field to allow incremental migrations.
# fid: fid
filename: filename
local_temp_path:
plugin: concat
delimiter: /
source:
- constants/source_base_path
- filepath
local_full_path:
-
plugin: callback
callable: file_exists
source: '@local_temp_path'
-
plugin: skip_on_empty
method: process
-
plugin: get
source: '@local_temp_path'
remote_full_path:
-
plugin: concat
delimiter: /
source:
- constants/remote_base_path
- filepath
-
plugin: urlencode
source_full_path:
-
plugin: null_coalesce
source:
- '@local_full_path'
- '@remote_full_path'
uri:
plugin: file_copy
source:
- '@source_full_path'
- uri
filemime: filemime
status: status
created: timestamp
changed: timestamp
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: uid
migration_dependencies:
optional:
- drupalorg_migrate_users
dependencies:
enforced:
module:
- drupalorg_migrate
langcode: en
status: true
id: drupalorg_migrate_blog_post_media_documents
#migration_tags:
# - 'Drupal 7'
# - Content
migration_group: drupalorg_migrate
label: 'Blog Post Media Entity Images to Media entities'
source:
plugin: d7_file_blog_post_files
scheme: public
constants:
# Path changed via hook_migration_plugins_alter
# and set via $config['drupalorg_migrate']['project_files']['source']
source_base_path: '/var/www/html/web/files/d7-files'
remote_base_path: 'https://www.drupal.org'
destination:
plugin: entity:media
default_bundle: document
process:
temp1:
- plugin: skip_on_value
method: row
not_equals: true
value:
- application/pdf
- application/vnd.oasis.opendocument.spreadsheet
source: filemime
field_media_document/target_id:
- plugin: migration_lookup
migration: drupalorg_migrate_blog_post_files
source: fid
field_media_document/description: description
status: status
created: timestamp
changed: timestamp
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: uid
migration_dependencies:
optional:
- drupalorg_migrate_users
- drupalorg_migrate_blog_post_files
dependencies:
enforced:
module:
- drupalorg_migrate
langcode: en
status: true
id: drupalorg_migrate_blog_post_media_images
#migration_tags:
# - 'Drupal 7'
# - Content
migration_group: drupalorg_migrate
label: 'Blog Post Media Entity Images to Media entities'
source:
plugin: d7_file_blog_post_files
scheme: public
constants:
# Path changed via hook_migration_plugins_alter
# and set via $config['drupalorg_migrate']['project_files']['source']
source_base_path: '/var/www/html/web/files/d7-files'
remote_base_path: 'https://www.drupal.org'
destination:
plugin: entity:media
default_bundle: image
process:
temp1:
- plugin: skip_on_value
method: row
not_equals: true
value:
- image/png
- image/jpeg
- image/gif
source: filemime
field_media_image/target_id:
- plugin: migration_lookup
migration: drupalorg_migrate_blog_post_files
source: fid
field_media_image/alt: alt
status: status
created: timestamp
changed: timestamp
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: uid
migration_dependencies:
optional:
- drupalorg_migrate_users
- drupalorg_migrate_blog_post_files
dependencies:
enforced:
module:
- drupalorg_migrate
id: drupalorg_migrate_book_listing
label: 'Drupal.org Book Listing'
migration_group: drupalorg_migrate
# Commenting out the below will require the d7_file migration.
#migration_tags:
# - Drupal 7
# - Content
#deriver: Drupal\node\Plugin\migrate\D7NodeDeriver
source:
plugin: d7_node
batch_size: 1000
track_changes: true
node_type: book_listing
destination:
plugin: entity:node
process:
nid: tnid
type:
plugin: default_value
default_value: book_listing
langcode:
plugin: default_value
source: language
default_value: "und"
title: title
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: node_uid
status: status
created: created
changed: changed
promote: promote
sticky: sticky
field_book_subtitle: field_book_subtitle
field_book_listing_authors: field_book_listing_authors
field_drupal_version:
plugin: sub_process
source: taxonomy_vocabulary_5
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_drupal_version
source: tid
field_book_format:
plugin: sub_process
source: taxonomy_vocabulary_62
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_book_format
source: tid
field_audience:
plugin: sub_process
source: taxonomy_vocabulary_38
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_audience
source: tid
field_keywords:
plugin: sub_process
source: taxonomy_vocabulary_54
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_keywords
source: tid
field_level:
plugin: sub_process
source: taxonomy_vocabulary_56
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_level
source: tid
field_book_availability:
plugin: sub_process
source: taxonomy_vocabulary_60
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_book_availability
source: tid
field_publisher: field_publisher
field_book_listing_date: field_book_listing_date
field_book_page_count: field_book_page_count
field_official_website:
plugin: field_link
uri_scheme: 'https://'
source: field_official_website
field_book_isbn_13: field_book_isbn_13
field_book_isbn_10: field_book_isbn_10
field_book_purchase_link:
plugin: field_link
uri_scheme: 'https://'
source: field_book_purchase_link
field_book_description: field_book_description
field_cover_image:
plugin: sub_process
source: field_cover_image
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_book_listing_cover_image_media
source: fid
migration_dependencies:
optional:
- drupalorg_migrate_users
- drupalorg_migrate_drupal_version
- drupalorg_migrate_book_format
- drupalorg_migrate_audience
- drupalorg_migrate_keywords
- drupalorg_migrate_level
- drupalorg_migrate_book_availability
- drupalorg_migrate_book_listing_cover_image_media
dependencies:
enforced:
module:
- drupalorg_migrate
langcode: en
status: true
id: drupalorg_migrate_book_listing_cover_image_files
#migration_tags:
# - 'Drupal 7'
# - Content
migration_group: drupalorg_migrate
label: 'Migrate Book image Cover Image field Files'
source:
plugin: d7_file_book_listing_files
scheme: public
constants:
# Path changed via hook_migration_plugins_alter
# and set via $config['drupalorg_migrate']['project_files']['source']
source_base_path: '/var/www/html/web/files/d7-files'
remote_base_path: 'https://www.drupal.org'
destination:
plugin: entity:file
process:
# If you are using this file to build a custom migration consider removing
# the fid field to allow incremental migrations.
# fid: fid
filename: filename
local_temp_path:
plugin: concat
delimiter: /
source:
- constants/source_base_path
- filepath
local_full_path:
-
plugin: callback
callable: file_exists
source: '@local_temp_path'
-
plugin: skip_on_empty
method: process
-
plugin: get
source: '@local_temp_path'
remote_full_path:
-
plugin: concat
delimiter: /
source:
- constants/remote_base_path
- filepath
-
plugin: urlencode
source_full_path:
-
plugin: null_coalesce
source:
- '@local_full_path'
- '@remote_full_path'
uri:
plugin: file_copy
source:
- '@source_full_path'
- uri
filemime: filemime
status: status
created: timestamp
changed: timestamp
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: uid
migration_dependencies:
optional:
- drupalorg_migrate_users
dependencies:
enforced:
module:
- drupalorg_migrate
langcode: en
status: true
id: drupalorg_migrate_book_listing_cover_image_media
#migration_tags:
# - 'Drupal 7'
# - Content
migration_group: drupalorg_migrate
label: 'Book Listing cover image files to media entities'
source:
plugin: d7_file_book_listing_files
scheme: public
constants:
# Path changed via hook_migration_plugins_alter
# and set via $config['drupalorg_migrate']['project_files']['source']
source_base_path: '/var/www/html/web/files/d7-files'
remote_base_path: 'https://www.drupal.org'
destination:
plugin: entity:media
default_bundle: image
process:
field_media_image/target_id:
- plugin: migration_lookup
migration: drupalorg_migrate_book_listing_cover_image_files
source: fid
field_media_image/alt: alt
status: status
created: timestamp
changed: timestamp
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: uid
migration_dependencies:
optional:
- drupalorg_migrate_users
- drupalorg_migrate_book_listing_cover_image_files
dependencies:
enforced:
module:
- drupalorg_migrate
id: drupalorg_migrate_casestudy
label: 'Drupal.org Case Studies'
migration_group: drupalorg_migrate
# Commenting out the below will require the d7_file migration.
#migration_tags:
# - Drupal 7
# - Content
#deriver: Drupal\node\Plugin\migrate\D7NodeDeriver
source:
plugin: d7_node
batch_size: 1000
track_changes: true
node_type: casestudy
destination:
plugin: entity:node
process:
nid: tnid
type:
plugin: default_value
default_value: casestudy
langcode:
plugin: default_value
source: language
default_value: "und"
title: title
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: node_uid
status: status
created: created
changed: changed
promote: promote
sticky: sticky
field_logo:
plugin: sub_process
source: field_logo
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_casestudy_logo_media
source: fid
field_mainimage:
plugin: sub_process
source: field_mainimage
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_casestudy_mainimage_media
source: fid
field_sectors:
plugin: sub_process
source: taxonomy_vocabulary_50
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_sectors
source: tid
body: body
field_link:
plugin: field_link
uri_scheme: 'https://'
source: field_link
field_overview: field_overview
field_goals: field_goals
field_drupal_version:
plugin: sub_process
source: taxonomy_vocabulary_5
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_drupal_version
source: tid
# The other project content types will need to be added once their migrations have been created.
field_projects:
plugin: sub_process
source: field_projects
process:
target_id:
plugin: migration_lookup
migration:
- drupalorg_migrate_project_module
- drupalorg_migrate_project_theme
- drupalorg_migrate_project_distribution
- drupalorg_migrate_project_drupalorg
- drupalorg_migrate_project_release
- drupalorg_migrate_project_theme_engine
- drupalorg_migrate_project_core
source: target_id
no_stub: true
field_module_selection: field_module_selection
field_community: field_community
field_case_organizations:
plugin: sub_process
source: field_case_organizations
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_organizations
source: target_id
field_team_members:
plugin: sub_process
source: field_team_members
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: target_id
field_developed: field_developed
field_images:
plugin: sub_process
source: field_images
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_casestudy_images_media
source: fid
upload:
plugin: sub_process
source: upload
process:
target_id:
plugin: migration_lookup
migration:
- drupalorg_migrate_casestudy_upload_media_images
- drupalorg_migrate_casestudy_upload_media_documents
source: fid
field_status: field_status
field_cover_photo:
plugin: sub_process
source: field_cover_photo
process:
target_id:
plugin: migration_lookup
migration: drupalorg_migrate_casestudy_cover_photo_media
source: fid
migration_dependencies:
optional:
- drupalorg_migrate_users
- drupalorg_migrate_casestudy_upload_media_documents
- drupalorg_migrate_casestudy_upload_media_images
- drupalorg_migrate_casestudy_images_media
- drupalorg_migrate_casestudy_cover_photo_media
- drupalorg_migrate_casestudy_logo_media
- drupalorg_migrate_casestudy_mainimage_media
- drupalorg_migrate_project_module
- drupalorg_migrate_project_theme
- drupalorg_migrate_project_distribution
- drupalorg_migrate_project_drupalorg
- drupalorg_migrate_project_release
- drupalorg_migrate_project_theme_engine
- drupalorg_migrate_project_core
- drupalorg_migrate_sectors
- drupalorg_migrate_drupal_version
- drupalorg_migrate_organizations
dependencies:
enforced:
module:
- drupalorg_migrate
langcode: en
status: true
id: drupalorg_migrate_casestudy_cover_photo_files
#migration_tags:
# - 'Drupal 7'
# - Content
migration_group: drupalorg_migrate
label: 'Migrate Case Study Cover Photo field Files'
source:
plugin: d7_file_casestudy_files
source_field: cover_photo
scheme: public
constants:
# Path changed via hook_migration_plugins_alter
# and set via $config['drupalorg_migrate']['project_files']['source']
source_base_path: '/var/www/html/web/files/d7-files'
remote_base_path: 'https://www.drupal.org'
destination:
plugin: entity:file
process:
# If you are using this file to build a custom migration consider removing
# the fid field to allow incremental migrations.
# fid: fid
filename: filename
local_temp_path:
plugin: concat
delimiter: /
source:
- constants/source_base_path
- filepath
local_full_path:
-
plugin: callback
callable: file_exists
source: '@local_temp_path'
-
plugin: skip_on_empty
method: process
-
plugin: get
source: '@local_temp_path'
remote_full_path:
-
plugin: concat
delimiter: /
source:
- constants/remote_base_path
- filepath
-
plugin: urlencode
source_full_path:
-
plugin: null_coalesce
source:
- '@local_full_path'
- '@remote_full_path'
uri:
plugin: file_copy
source:
- '@source_full_path'
- uri
filemime: filemime
status: status
created: timestamp
changed: timestamp
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: uid
migration_dependencies:
optional:
- drupalorg_migrate_users
dependencies:
enforced:
module:
- drupalorg_migrate
langcode: en
status: true
id: drupalorg_migrate_casestudy_cover_photo_media
#migration_tags:
# - 'Drupal 7'
# - Content
migration_group: drupalorg_migrate
label: 'Case study cover photo files to media entities'
source:
plugin: d7_file_casestudy_files
source_field: cover_photo
scheme: public
constants:
# Path changed via hook_migration_plugins_alter
# and set via $config['drupalorg_migrate']['project_files']['source']
source_base_path: '/var/www/html/web/files/d7-files'
remote_base_path: 'https://www.drupal.org'
destination:
plugin: entity:media
default_bundle: image
process:
field_media_image/target_id:
- plugin: migration_lookup
migration: drupalorg_migrate_casestudy_cover_photo_files
source: fid
field_media_image/alt: alt
status: status
created: timestamp
changed: timestamp
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: uid
migration_dependencies:
optional:
- drupalorg_migrate_users
- drupalorg_migrate_casestudy_cover_photo_files
dependencies:
enforced:
module:
- drupalorg_migrate
langcode: en
status: true
id: drupalorg_migrate_casestudy_images_files
#migration_tags:
# - 'Drupal 7'
# - Content
migration_group: drupalorg_migrate
label: 'Migrate Case Study Images field Files'
source:
plugin: d7_file_casestudy_files
source_field: images
scheme: public
constants:
# Path changed via hook_migration_plugins_alter
# and set via $config['drupalorg_migrate']['project_files']['source']
source_base_path: '/var/www/html/web/files/d7-files'
remote_base_path: 'https://www.drupal.org'
destination:
plugin: entity:file
process:
# If you are using this file to build a custom migration consider removing
# the fid field to allow incremental migrations.
# fid: fid
filename: filename
local_temp_path:
plugin: concat
delimiter: /
source:
- constants/source_base_path
- filepath
local_full_path:
-
plugin: callback
callable: file_exists
source: '@local_temp_path'
-
plugin: skip_on_empty
method: process
-
plugin: get
source: '@local_temp_path'
remote_full_path:
-
plugin: concat
delimiter: /
source:
- constants/remote_base_path
- filepath
-
plugin: urlencode
source_full_path:
-
plugin: null_coalesce
source:
- '@local_full_path'
- '@remote_full_path'
uri:
plugin: file_copy
source:
- '@source_full_path'
- uri
filemime: filemime
status: status
created: timestamp
changed: timestamp
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: uid
migration_dependencies:
optional:
- drupalorg_migrate_users
dependencies:
enforced:
module:
- drupalorg_migrate
langcode: en
status: true
id: drupalorg_migrate_casestudy_images_media
#migration_tags:
# - 'Drupal 7'
# - Content
migration_group: drupalorg_migrate
label: 'Case study images field files to media entities'
source:
plugin: d7_file_casestudy_files
source_field: images
scheme: public
constants:
# Path changed via hook_migration_plugins_alter
# and set via $config['drupalorg_migrate']['project_files']['source']
source_base_path: '/var/www/html/web/files/d7-files'
remote_base_path: 'https://www.drupal.org'
destination:
plugin: entity:media
default_bundle: image
process:
field_media_image/target_id:
- plugin: migration_lookup
migration: drupalorg_migrate_casestudy_images_files
source: fid
field_media_image/alt: alt
status: status
created: timestamp
changed: timestamp
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: uid
migration_dependencies:
optional:
- drupalorg_migrate_users
- drupalorg_migrate_casestudy_images_files
dependencies:
enforced:
module:
- drupalorg_migrate
langcode: en
status: true
id: drupalorg_migrate_casestudy_logo_files
#migration_tags:
# - 'Drupal 7'
# - Content
migration_group: drupalorg_migrate
label: 'Migrate Case Study Logo field Files'
source:
plugin: d7_file_casestudy_files
source_field: logo
scheme: public
constants:
# Path changed via hook_migration_plugins_alter
# and set via $config['drupalorg_migrate']['project_files']['source']
source_base_path: '/var/www/html/web/files/d7-files'
remote_base_path: 'https://www.drupal.org'
destination:
plugin: entity:file
process:
# If you are using this file to build a custom migration consider removing
# the fid field to allow incremental migrations.
# fid: fid
filename: filename
local_temp_path:
plugin: concat
delimiter: /
source:
- constants/source_base_path
- filepath
local_full_path:
-
plugin: callback
callable: file_exists
source: '@local_temp_path'
-
plugin: skip_on_empty
method: process
-
plugin: get
source: '@local_temp_path'
remote_full_path:
-
plugin: concat
delimiter: /
source:
- constants/remote_base_path
- filepath
-
plugin: urlencode
source_full_path:
-
plugin: null_coalesce
source:
- '@local_full_path'
- '@remote_full_path'
uri:
plugin: file_copy
source:
- '@source_full_path'
- uri
filemime: filemime
status: status
created: timestamp
changed: timestamp
uid:
plugin: migration_lookup
migration: drupalorg_migrate_users
source: uid
migration_dependencies:
optional:
- drupalorg_migrate_users
dependencies:
enforced:
module:
- drupalorg_migrate