Skip to content

Instantly share code, notes, and snippets.

@dinarcon
dinarcon / pantheon_drupal_migration.sh
Created October 27, 2021 22:16
Run Drupal migrations on Pantheon
#!/bin/bash
# Script to run Drupal migrations on Pantheon.
# See also https://pantheon.io/blog/running-drupal-8-data-migrations-pantheon-through-drush
# Make sure the command is called with at least 3 arguments. Example:
# ./pantheon_drupal_migration.sh target_environment.multidev source_environment.multidev upgrade_d7_user upgrade_d7_file
[ $# -lt 3 ] && { echo "Usage: $0 [d9_target_site_id.env] [d6_source_site_id.env] [migration_ids]" ; exit 1; }
TARGET=$1
@dinarcon
dinarcon / quick-start.md
Created July 11, 2020 20:48
Install Drupal with the quick-start command
process:
title:
- plugin: concat
source:
- source_first_name
- source_last_name
delimiter: ' '
- plugin: callback
callable: strtoupper
@dinarcon
dinarcon / behat-test.feature
Created September 7, 2019 21:03
WordPress BDD testing with Behat and WordHat
Feature: Visibility of the homepage
In order to have confidence that my site is accessible
As a site administrator
I want to verify I can visit the homepage
Scenario: Verify the homepage
Given I am on the homepage
Then the response status code should be 200
# config.yml file
# Based off default.config.yml
vagrant_hostname: migratedebug.test
vagrant_machine_name: migratedebug
# For dynamic IP assignment the 'vagrant-auto_network' plugin is required.
# Otherwise, use an IP address that has not been used by any other virtual machine.
vagrant_ip: 0.0.0.0
# All the other extra packages can remain enabled.
# Make sure the following three get installed by uncommenting them.
"extra": {
"patches": {
"drupal/migrate_devel": {
"drush 9 support": "https://www.drupal.org/files/issues/2018-10-08/migrate_devel-drush9-2938677-6.patch"
},
"drupal/migrate_tools": {
"--limit option": "https://www.drupal.org/files/issues/2019-08-19/3024399-55.patch"
}
}
}
# Source values: 3.1415, 2.7182, and 1.4142
psf_number_components:
plugin: explode
source: src_decimal_number
field_tags:
- plugin: skip_on_empty
source: src_fruit_list
method: process
message: 'No src_fruit_list listed.'
- plugin: explode
delimiter: ','
- plugin: callback
callable: trim
- plugin: entity_generate
$ drush migrate:import --tag='UD Config Group (JSON Source)'
$ drush migrate:rollback --tag='UD Config Group (JSON Source)'
$ drush migrate:import --group='udm_config_group_json_source'
$ drush migrate:rollback --group='udm_config_group_json_source'