Commit ffde2454 authored by alexpott's avatar alexpott

Issue #2500533 by quietone, phenaproxima: Upgrade path for System 7.x

parent 0fe04b15
id: d6_action_settings
id: action_settings
label: Action configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: variable
variables:
......
......@@ -24,7 +24,7 @@ class MigrateActionConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_action_settings');
$this->executeMigration('action_settings');
}
/**
......
<?php
namespace Drupal\Tests\action\Kernel\Migrate\d7;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Upgrade variables to action.settings.yml.
*
* @group migrate_drupal_7
*/
class MigrateActionConfigsTest extends MigrateDrupal7TestBase {
use SchemaCheckTestTrait;
/**
* {@inheritdoc}
*/
public static $modules = ['action'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('action_settings');
}
/**
* Tests migration of action variables to action.settings.yml.
*/
public function testActionSettings() {
$config = $this->config('action.settings');
$this->assertSame(28, $config->get('recursion_limit'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'action.settings', $config->get());
}
}
id: d6_file_settings
id: file_settings
label: File configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: variable
variables:
......
......@@ -19,7 +19,7 @@ class MigrateFileConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_file_settings');
$this->executeMigration('file_settings');
}
/**
......
<?php
namespace Drupal\Tests\file\Kernel\Migrate\d7;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Upgrade variables to file.settings.yml.
*
* @group migrate_drupal_7
*/
class MigrateFileConfigsTest extends MigrateDrupal7TestBase {
use SchemaCheckTestTrait;
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('file_settings');
}
/**
* Tests migration of file variables to file.settings.yml.
*/
public function testFileSettings() {
$config = $this->config('file.settings');
$this->assertSame('textfield', $config->get('description.type'));
$this->assertSame(256, $config->get('description.length'));
$this->assertSame('sites/default/files/icons', $config->get('icon.directory'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'file.settings', $config->get());
}
}
......@@ -41082,6 +41082,10 @@
'name',
'value',
))
->values(array(
'name' => 'actions_max_stack',
'value' => 'i:28;',
))
->values(array(
'name' => 'additional_settings__active_tab_article',
'value' => 's:15:"edit-submission";',
......@@ -41106,6 +41110,10 @@
'name' => 'additional_settings__active_tab_test_content_type',
'value' => 's:13:"edit-workflow";',
))
->values(array(
'name' => 'admin_compact_mode',
'value' => 'b:1;',
))
->values(array(
'name' => 'admin_theme',
'value' => 's:5:"seven";',
......@@ -41142,10 +41150,18 @@
'name' => 'allow_insecure_derivatives',
'value' => 'b:1;',
))
->values(array(
'name' => 'allow_insecure_uploads',
'value' => 'i:1;',
))
->values(array(
'name' => 'anonymous',
'value' => 's:9:"Anonymous";',
))
->values(array(
'name' => 'authorize_filetransfer_default',
'value' => 's:3:"ftp";',
))
->values(array(
'name' => 'block_cache',
'value' => 'i:0;',
......@@ -41158,6 +41174,10 @@
'name' => 'book_child_type',
'value' => 's:4:"book";',
))
->values(array(
'name' => 'cache',
'value' => 'i:0;',
))
->values(array(
'name' => 'cache_flush_cache',
'value' => 'i:0;',
......@@ -41370,6 +41390,10 @@
'name' => 'comment_test_content_type',
'value' => 's:1:"2";',
))
->values(array(
'name' => 'configurable_timezones',
'value' => 'b:1;',
))
->values(array(
'name' => 'contact_default_status',
'value' => 'i:1;',
......@@ -41390,6 +41414,14 @@
'name' => 'cron_last',
'value' => 'i:1444944970;',
))
->values(array(
'name' => 'cron_threshold_error',
'value' => 'i:1209600;',
))
->values(array(
'name' => 'cron_threshold_warning',
'value' => 'i:172800;',
))
->values(array(
'name' => 'css_js_query_string',
'value' => 's:6:"nwa6nq";',
......@@ -41410,6 +41442,10 @@
'name' => 'date_default_timezone',
'value' => 's:15:"America/Chicago";',
))
->values(array(
'name' => 'date_first_day',
'value' => 'i:1;',
))
->values(array(
'name' => 'dblog_row_limit',
'value' => 'i:10000;',
......@@ -41430,10 +41466,30 @@
'name' => 'drupal_private_key',
'value' => 's:43:"9eRJWxrMwQ5CufYJjXBZbPGz_t8vPIYRQr18PamdKmM";',
))
->values(array(
'name' => 'drupal_weight_select_max',
'value' => 'i:40;',
))
->values(array(
'name' => 'email__active_tab',
'value' => 's:27:"edit-email-pending-approval";',
))
->values(array(
'name' => 'empty_timezone_message',
'value' => 'b:1;',
))
->values(array(
'name' => 'error_level',
'value' => 'i:1;',
))
->values(array(
'name' => 'feed_default_items',
'value' => 'i:27;',
))
->values(array(
'name' => 'feed_item_length',
'value' => 's:8:"fulltext";',
))
->values(array(
'name' => 'field_bundle_settings_comment__comment_node_test_content_type',
'value' => 'a:2:{s:10:"view_modes";a:0:{}s:12:"extra_fields";a:2:{s:4:"form";a:2:{s:6:"author";a:1:{s:6:"weight";s:2:"-2";}s:7:"subject";a:1:{s:6:"weight";s:2:"-1";}}s:7:"display";a:0:{}}}',
......@@ -41450,6 +41506,22 @@
'name' => 'file_default_scheme',
'value' => 's:6:"public";',
))
->values(array(
'name' => 'file_description_length',
'value' => 'i:256;',
))
->values(array(
'name' => 'file_description_type',
'value' => 's:9:"textfield";',
))
->values(array(
'name' => 'file_directory_path',
'value' => 's:19:"sites/default/files";',
))
->values(array(
'name' => 'file_icon_directory',
'value' => 's:25:"sites/default/files/icons";',
))
->values(array(
'name' => 'file_private_path',
'value' => 's:0:"";',
......@@ -41494,10 +41566,18 @@
'name' => 'forum_per_page',
'value' => 'i:25;',
))
->values(array(
'name' => 'image_jpeg_quality',
'value' => 'i:80;',
))
->values(array(
'name' => 'image_style_preview_image',
'value' => 's:33:"core/modules/image/testsample.png";',
))
->values(array(
'name' => 'image_toolkit',
'value' => 's:2:"gd";',
))
->values(array(
'name' => 'install_profile',
'value' => 's:8:"standard";',
......@@ -41574,6 +41654,10 @@
'name' => 'locale_language_negotiation_url_part',
'value' => 's:6:"domain";',
))
->values(array(
'name' => 'mail_system',
'value' => 'a:1:{s:14:"default-system";s:17:"DefaultMailSystem";}',
))
->values(array(
'name' => 'maintenance_mode',
'value' => 'i:0;',
......@@ -41838,6 +41922,10 @@
'name' => 'site_name',
'value' => 's:13:"The Site Name";',
))
->values(array(
'name' => 'site_offline_message',
'value' => 's:42:"This is a custom maintenance mode message.";',
))
->values(array(
'name' => 'site_slogan',
'value' => 's:10:"The Slogan";',
......@@ -41878,6 +41966,14 @@
'name' => 'syslog_identity',
'value' => 's:6:"drupal";',
))
->values(array(
'name' => 'taxonomy_override_selector',
'value' => 'b:1;',
))
->values(array(
'name' => 'taxonomy_terms_per_page_admin',
'value' => 'i:84;',
))
->values(array(
'name' => 'teaser_length',
'value' => 'i:1024;',
......@@ -41922,6 +42018,10 @@
'name' => 'user_cancel_method',
'value' => 's:17:"user_cancel_block";',
))
->values(array(
'name' => 'user_default_timezone',
'value' => 'i:2;',
))
->values(array(
'name' => 'user_email_verification',
'value' => 'i:1;',
......@@ -30,7 +30,7 @@ class MigrateUpgradeForm extends ConfirmFormBase {
* @var array[]
*/
protected $moduleUpgradePaths = [
'd6_action_settings' => [
'action_settings' => [
'source_module' => 'system',
'destination_module' => 'action',
],
......@@ -214,7 +214,7 @@ class MigrateUpgradeForm extends ConfirmFormBase {
'source_module' => 'system',
'destination_module' => 'file',
],
'd6_file_settings' => [
'file_settings' => [
'source_module' => 'system',
'destination_module' => 'file',
],
......@@ -422,19 +422,19 @@ class MigrateUpgradeForm extends ConfirmFormBase {
'source_module' => 'system',
'destination_module' => 'system',
],
'd6_system_image' => [
'system_image' => [
'source_module' => 'system',
'destination_module' => 'system',
],
'd6_system_image_gd' => [
'system_image_gd' => [
'source_module' => 'system',
'destination_module' => 'system',
],
'd6_system_logging' => [
'system_logging' => [
'source_module' => 'system',
'destination_module' => 'system',
],
'd6_system_maintenance' => [
'system_maintenance' => [
'source_module' => 'system',
'destination_module' => 'system',
],
......@@ -442,11 +442,35 @@ class MigrateUpgradeForm extends ConfirmFormBase {
'source_module' => 'system',
'destination_module' => 'system',
],
'd6_system_rss' => [
'system_rss' => [
'source_module' => 'system',
'destination_module' => 'system',
],
'd6_system_site' => [
'system_site' => [
'source_module' => 'system',
'destination_module' => 'system',
],
'd7_system_authorize' => [
'source_module' => 'system',
'destination_module' => 'system',
],
'd7_system_cron' => [
'source_module' => 'system',
'destination_module' => 'system',
],
'd7_system_date' => [
'source_module' => 'system',
'destination_module' => 'system',
],
'd7_system_file' => [
'source_module' => 'system',
'destination_module' => 'system',
],
'd7_system_mail' => [
'source_module' => 'system',
'destination_module' => 'system',
],
'd7_system_performance' => [
'source_module' => 'system',
'destination_module' => 'system',
],
......
......@@ -49,7 +49,7 @@ protected function getEntityCounts() {
'filter_format' => 7,
'image_style' => 6,
'language_content_settings' => 2,
'migration' => 59,
'migration' => 73,
'node' => 3,
'node_type' => 6,
'rdf_mapping' => 5,
......
id: d7_system_authorize
migration_tags:
- Drupal 7
source:
plugin: variable
variables:
- authorize_filetransfer_default
process:
filetransfer_default: authorize_filetransfer_default
destination:
plugin: config
config_name: system.authorize
id: d7_system_cron
label: Drupal 7 cron settings
migration_tags:
- Drupal 7
source:
plugin: variable
variables:
- cron_threshold_warning
- cron_threshold_error
process:
'threshold/requirements_warning': cron_threshold_warning
'threshold/requirements_error': cron_threshold_error
destination:
plugin: config
config_name: system.cron
id: d7_system_date
migration_tags:
- Drupal 7
source:
plugin: variable
variables:
- site_default_country
- date_first_day
- date_default_timezone
- configurable_timezones
- empty_timezone_message
- user_default_timezone
process:
'country/default': site_default_country
first_day: date_first_day
'timezone/default': date_default_timezone
'timezone/user/configurable': configurable_timezones
'timezone/user/warn': empty_timezone_message
'timezone/user/default': user_default_timezone
destination:
plugin: config
config_name: system.date
id: d7_system_file
label: Drupal 7 file system configuration
migration_tags:
- Drupal 7
source:
plugin: variable
variables:
- allow_insecure_uploads
- file_temporary_path
process:
allow_insecure_uploads:
plugin: static_map
source: allow_insecure_uploads
map:
0: FALSE
1: TRUE
'path/temporary': file_temporary_path
destination:
plugin: config
config_name: system.file
id: d7_system_mail
migration_tags:
- Drupal 7
source:
plugin: variable
variables:
- mail_system
process:
'interface/default':
plugin: static_map
source: 'mail_system/default-system'
map:
DefaultMailSystem: php_mail
MailTestCase: test_mail_collector
destination:
plugin: config
config_name: system.mail
id: d7_system_performance
label: Drupal 7 performance configuration
migration_tags:
- Drupal 7
source:
plugin: variable
variables:
- preprocess_css
- preprocess_js
- cache_lifetime
- page_compression
process:
'css/preprocess': preprocess_css
'js/preprocess': preprocess_js
'cache/page/max_age': cache_lifetime
'response/gzip': page_compression
destination:
plugin: config
config_name: system.performance
id: d6_system_image
id: system_image
label: Image toolkit configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: variable
variables:
......
id: d6_system_image_gd
id: system_image_gd
label: Image quality configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: variable
variables:
......
id: d6_system_logging
id: system_logging
label: System logging
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: variable
variables:
......
id: d6_system_maintenance
id: system_maintenance
label: Maintenance page configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: variable
variables:
......
id: d6_system_rss
id: system_rss
label: RSS configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: variable
variables:
......
id: d6_system_site
id: system_site
label: Site configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: variable
constants:
......
......@@ -16,7 +16,7 @@ class MigrateSystemImageGdTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_image_gd');
$this->executeMigration('system_image_gd');
}
/**
......
......@@ -16,7 +16,7 @@ class MigrateSystemImageTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_image');
$this->executeMigration('system_image');
}
/**
......
......@@ -19,7 +19,7 @@ class MigrateSystemLoggingTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_logging');
$this->executeMigration('system_logging');
}
/**
......
......@@ -16,7 +16,7 @@ class MigrateSystemMaintenanceTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_maintenance');
$this->executeMigration('system_maintenance');
}
/**
......
......@@ -16,7 +16,7 @@ class MigrateSystemRssTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_rss');
$this->executeMigration('system_rss');
}
/**
......
......@@ -16,7 +16,7 @@ class MigrateSystemSiteTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_system_site');
$this->executeMigration('system_site');
}
/**
......
<?php
namespace Drupal\Tests\system\Kernel\Migrate\d7;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Migrates various configuration objects owned by the System module.
*
* @group migrate_drupal_7
*/
class MigrateSystemConfigurationTest extends MigrateDrupal7TestBase {
public static $modules = ['action', 'file', 'system'];
protected $expectedConfig = [
'system.authorize' => [
'filetransfer_default' => 'ftp',
],
'system.cron' => [
'threshold' => [
// autorun is not handled by the migration.
// 'autorun' => 0,
'requirements_warning' => 172800,