geolocation-8.x-3.x-dev/modules/geolocation_geometry/modules/geolocation_geometry_data/config/optional/migrate_plus.migration.geolocation_geometry_countries.yml
modules/geolocation_geometry/modules/geolocation_geometry_data/config/optional/migrate_plus.migration.geolocation_geometry_countries.yml
# A "migration" is, in technical terms, a plugin whose configuration describes
# how to read source data, process it (generally by mapping source fields to
# destination fields), and write it to Drupal.
# The machine name for a migration, used to uniquely identify it.
id: geolocation_geometry_countries
# A human-friendly description of the migration.
label: "Countries of the World"
migration_group: geolocation_geometry_data
# The category or tag for the migration.
migration_tags:
- geolocation
source:
plugin: url
data_fetcher_plugin: http
headers:
Referer: https://www.naturalearthdata.com
data_parser_plugin: geolocation_shapefile
urls:
- https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip
fields:
- name: geojson
label: 'GeoJSON'
- name: NAME
label: 'Name of Country'
ids:
NAME:
type: string
# Every migration must also have a destination plugin, which handles writing
# the migrated data in the appropriate form for that particular kind of data.
# Most Drupal content is an "entity" of one type or another, and we need to
# specify what entity type we are populating (in this case, taxonomy terms).
# Unlike the source plugin (which is specific to our particular scenario), this
# destination plugin is implemented in Drupal itself.
destination:
plugin: entity:taxonomy_term
# Here's the meat of the migration - the processing pipeline. This describes how
# each destination field is to be populated based on the source data. For each
# destination field, one or more process plugins may be invoked.
process:
# The simplest process plugin is named 'get' - it is the default plugin, so
# does not need to be explicitly named. It simply copies the source value
# (the 'style' field from the source database in this case) to the destination
# field (the taxonomy term 'name' field). You can see we simply copy the
# source 'details' field to destination 'description' field in the same way.
name: NAME
field_geometry_data_geometry: geojson
# Here is a new plugin - default_value. In its simplest usage here, it is used
# to hard-code a destination value, the vid (vocabulary ID) our taxonomy terms
# should be assigned to. It's important to note that while above the right
# side of the mappings was a source field name, here the right side of the
# 'default_value:' line is an actual value.
vid:
plugin: default_value
default_value: geolocation_geometry_countries
migration_dependencies: {}
# By default, configuration entities (like this migration) are not automatically
# removed when the migration which installed them is uninstalled. To have your
# migrations uninstalled with your migration module, add an enforced dependency
# on your module.
dependencies:
enforced:
module:
- geolocation_geometry_data
