clean install

This commit is contained in:
2024-12-10 15:08:16 +01:00
commit e14eb2d8fd
31193 changed files with 3555714 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
# This migration demonstrates importing from SOAP/WSDL.
id: weather_soap
label: SOAP service providing weather.
migration_group: wine
migration_tags:
- advanced example
source:
# We use the SOAP parser source plugin.
plugin: url
data_fetcher_plugin: http # Ignored - SoapClient does the fetching.
data_parser_plugin: soap
# URL of a WSDL endpoint.
urls:
- http://www.webservicex.net/globalweather.asmx?WSDL
# The function to call on the service, and the parameters to pass. See
# http://www.webservicex.net/New/Home/ServiceDetail/56 for the XML structure
# of this feed - how CountryName is passed within the GetCitiesByCountry
# XML element.
function: GetCitiesByCountry
parameters:
CountryName: Spain
# Responses may be returned as an XML string, an object, or an array - specify
# the type of response here.
response_type: xml
# Looking at the XML response at http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry,
# we see that the data items we want are within <NewDataSet><Table>.
item_selector: /NewDataSet/Table
# For each field, 'name' is the source property name to be used in the process
# steps below, 'label' is optional (to document the property), and selector
# is an xpath (-like, for array and object returns) string relative to the
# item_selector for retrieving that data value.
fields:
-
name: Country
label: Country
selector: Country
-
name: City
label: City
selector: City
# 'ids' tells us what source property ('City') holds the unique identifying
# value for each imported item, and what schema type to use to hold that
# value in the migration map an message tables.
ids:
City:
type: string
process:
vid:
plugin: default_value
default_value: migrate_example_wine_varieties
name: City
destination:
plugin: entity:taxonomy_term
migration_dependencies:
required: {}
optional: {}

View File

@@ -0,0 +1,58 @@
# This migration demonstrates importing from a monolithic JSON file.
id: wine_role_json
label: JSON feed of roles (positions)
migration_group: wine
migration_tags:
- advanced example
source:
# We use the JSON source plugin.
plugin: url
data_fetcher_plugin: http
data_parser_plugin: json
# The data_parser normally limits the fields passed on to the source plugin
# to fields configured to be used as part of the migration. To support more
# dynamic migrations, the JSON data parser supports including the original
# data for the current row. Simply include the 'include_raw_data' flag set
# to `true` to enable this. This option is disabled by default to minimize
# memory footprint for migrations that do not need this capability.
# include_raw_data: true
# Normally, this is one or more fully-qualified URLs or file paths. Because
# we can't hardcode your local URL, we provide a relative path here which
# hook_install() will rewrite to a full URL for the current site.
urls:
- /migrate_example_advanced_position?_format=json
# An xpath-like selector corresponding to the items to be imported.
item_selector: position
# Under 'fields', we list the data items to be imported. The first level keys
# are the source field names we want to populate (the names to be used as
# sources in the process configuration below). For each field we're importing,
# we provide a label (optional - this is for display in migration tools) and
# an xpath for retrieving that value. It's important to note that this xpath
# is relative to the elements retrieved by item_selector.
fields:
-
name: machine_name
label: 'Unique position identifier'
selector: sourceid
-
name: friendly_name
label: 'Position name'
selector: name
# Under 'ids', we identify source fields populated above which will uniquely
# identify each imported item. The 'type' makes sure the migration map table
# uses the proper schema type for stored the IDs.
ids:
machine_name:
type: string
process:
# Note that the source field names here (machine_name and friendly_name) were
# defined by the 'fields' configuration for the source plugin above.
id: machine_name
label: friendly_name
destination:
plugin: entity:user_role
migration_dependencies: {}
dependencies:
enforced:
module:
- migrate_example_advanced

View File

@@ -0,0 +1,54 @@
# This migration demonstrates importing from a monolithic XML file.
id: wine_role_xml
label: XML feed of roles (positions)
migration_group: wine
migration_tags:
- advanced example
source:
# We use the XML data parser plugin.
plugin: url
data_fetcher_plugin: http
data_parser_plugin: xml
# Normally, this is one or more fully-qualified URLs or file paths. Because
# we can't hardcode your local URL, we provide a relative path here which
# hook_install() will rewrite to a full URL for the current site.
urls:
- /migrate_example_advanced_position?_format=xml
# Visit the URL above (relative to your site root) and look at it. You can see
# that <response> is the outer element, and each item we want to import is a
# <position> element. The item_xpath value is the xpath to use to query the
# desired elements.
item_selector: /response/position
# Under 'fields', we list the data items to be imported. The first level keys
# are the source field names we want to populate (the names to be used as
# sources in the process configuration below). For each field we're importing,
# we provide a label (optional - this is for display in migration tools) and
# an xpath for retrieving that value. It's important to note that this xpath
# is relative to the elements retrieved by item_xpath.
fields:
-
name: machine_name
label: 'Unique position identifier'
selector: sourceid
-
name: friendly_name
label: 'Position name'
selector: name
# Under 'ids', we identify source fields populated above which will uniquely
# identify each imported item. The 'type' makes sure the migration map table
# uses the proper schema type for stored the IDs.
ids:
machine_name:
type: string
process:
# Note that the source field names here (machine_name and friendly_name) were
# defined by the 'fields' configuration for the source plugin above.
id: machine_name
label: friendly_name
destination:
plugin: entity:user_role
migration_dependencies: {}
dependencies:
enforced:
module:
- migrate_example_advanced

View File

@@ -0,0 +1,39 @@
id: wine_terms
label: Migrate all categories into Drupal taxonomy terms
migration_group: wine
migration_tags:
- advanced example
source:
plugin: wine_term
destination:
plugin: entity:taxonomy_term
process:
name: name
description: details
# Usually, one wants to have a separate migration for each entity_type/bundle
# combination - e.g., separate migrations for articles and blog posts, as
# opposed to a single monolithic node migration. This affords maximum
# control - the ability to import just one bundle at a time, and most
# importantly to have distinct field mappings (because different node types
# usually have different fields). In this case, though, because all of the
# vocabularies we're importing come from a common table, and on the Drupal
# side there are no distinct custom fields, we are able to import them all in
# one migration. The static_map tells the migration in which vocabulary to
# place each term, based on the incoming 'type' column.
vid:
plugin: static_map
source: type
map:
best_with: migrate_example_wine_best_with
region: migrate_example_wine_regions
variety: migrate_example_wine_varieties
parent:
plugin: migration_lookup
migration: wine_terms
source: category_parent
weight: ordering
migration_dependencies: {}
dependencies:
enforced:
module:
- migrate_example_advanced

View File

@@ -0,0 +1,74 @@
# This migration demonstrates importing from multiple XML files.
id: wine_variety_multi_xml
label: XML feed of varieties
migration_group: wine
migration_tags:
- advanced example
source:
# We use the XML source plugin.
plugin: url
data_fetcher_plugin: http
data_parser_plugin: xml
# Guzzle request options can be added.
request_options:
allow_redirects: false
# Normally, this is one or more fully-qualified URLs or file paths. Because
# we can't hardcode your local URL, we provide a relative path here which
# hook_install() will rewrite to a full URL for the current site.
urls:
- /migrate_example_advanced_variety_multiple/red?_format=xml
- /migrate_example_advanced_variety_multiple/white?_format=xml
# Visit the URL above (relative to your site root) and look at it. You can see
# that <response> is the outer element, and each item we want to import is a
# <position> element. The item_xpath value is the xpath to use to query the
# desired elements.
item_selector: /response/variety
# Under 'fields', we list the data items to be imported. The first level keys
# are the source field names we want to populate (the names to be used as
# sources in the process configuration below). For each field we're importing,
# we provide a label (optional - this is for display in migration tools) and
# an xpath for retrieving that value. It's important to note that this xpath
# is relative to the elements retrieved by item_xpath.
fields:
-
name: category_name
label: Name
selector: name
-
name: category_details
label: Details
selector: details
-
name: category_parent
label: 'Unique position identifier'
selector: parent
-
name: category_attributes
label: 'List of variety attributes'
selector: attributes
# Under 'ids', we identify source fields populated above which will uniquely
# identify each imported item. The 'type' makes sure the migration map table
# uses the proper schema type for stored the IDs.
ids:
category_name:
type: string
process:
vid:
plugin: default_value
default_value: migrate_example_wine_varieties
name: category_name
description: category_details
parent:
plugin: migration_lookup
migration: wine_terms
source: category_parent
field_variety_attributes: category_attributes
destination:
plugin: entity:taxonomy_term
migration_dependencies:
required:
- wine_terms
dependencies:
enforced:
module:
- migrate_example_advanced

View File

@@ -0,0 +1,11 @@
id: wine
label: Wine Imports
description: A few wine-related imports, demonstrating some more advanced migration techniques.
source_type: Custom tables and XML
shared_configuration:
source:
key: default
dependencies:
enforced:
module:
- migrate_example_advanced