-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a custom Migrate destination plugin that allows testing of metadata migrations #1021
Comments
Maybe even the |
👍 to letting people sneak a peak before pulling the trigger on a potentially long migration. |
Let me poke around a bit. Might be a good way to warn people about stuff like #1017 which they could then fix in the source, if applicable. |
Some preliminary luck (only a little bit of it good) with using the
Which is something. Steps I took:
Here's my
Notice that it contains no source taxonomy terms. When you include them, they get created as terms, they do not get persisted to the table. I'm getting errors like these. The nodes I am importing are linked to another table,
Here's my .install file that creates the destination table: <?php
/**
* @file
* Install/update hook implementations.
*/
/**
* Implements hook_schema().
*/
function islandora_migrate_7x_dry_run_schema() {
$schema = [];
$schema['islandora_migrate_7x_dry_run'] = [
'description' => 'Table used as a destination in dry run migrations from from Islandora 7.x.',
'fields' => [
'localid' => [
'description' => 'The local ID in this database table.',
'type' => 'serial',
'not null' => TRUE,
'unique' => TRUE,
],
'PID' => [
'description' => 'The 7.x PID',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'unique' => TRUE,
],
'model' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'created' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'lastmodified' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'title' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'subtitle' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'resource_type' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'description' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'extent' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'member_of' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'person_agents' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'person_roles' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'corporate_agents' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'corporate_roles' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'topic' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'temporal' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'geographic' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'continent' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'country' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'province' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'region' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'city' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
'city_section' => [
'description' => '',
'type' => 'text',
'size' => 'normal',
],
],
'primary key' => ['localid'],
];
return $schema;
} I'm going to try hacking together a custom CSV destination plugin to get me past some of the Schema hassles. I'll report back. |
Just bouncing an idea around here, but it would be great to be able to test a migration before committing to it, particularly one from an Islandora 7.x instance using https://github.com/Islandora-Devops/migrate_7x_claw. I notice that the Migrate Plus module provides a Table destination plugin (
migrate_plus/src/Plugin/migrate/destination/Table.php
). I wonder if we could use this to test a migration? Or use it as the basis for a custom plugin that writes the migrated data to a CSV file for manual inspection?The workflow I am imagining is:
destination
plugin instead ofplugin: 'entity:node'
,plugin: 'entity:taxonomy_term'
, etc.plugin: 'entity:node'
,plugin: 'entity:taxonomy_term'
, etc.The text was updated successfully, but these errors were encountered: