islandora / migrate_7x_claw
辅助Islandora 7.x到CLAW迁移的工具。
Requires
- drupal/migrate_plus: ^4
- jonathangreen/tuque: dev-master
Requires (Dev)
- drupal/coder: *
- phpunit/phpunit: ^6
- sebastian/phpcpd: *
- squizlabs/php_codesniffer: 2.8.1
README
此模块包含插件,可从Fedora 3 Islandora实例导入数据到Islandora 8实例。它还包含一个子模块功能,其中包含一些示例迁移。示例迁移基于纯Islandora 7.x解决方案包中的表单,旨在与在islandora_defaults
中定义的字段一起使用。如果您自定义了MODS表单,则还需要自定义示例迁移和islandora_defaults
。
目前,以下内容模型可以完整迁移
- 集合
- 基本图像
- 大图像
- 音频
- 视频
- 二进制
如果您想查看一些带有元数据的样本基本图像对象,可以查看以下zip文件,您可以使用islandora_zip_batch_importer
使用它:此zip文件。所有图像均来自Pexels,可用于个人或商业用途,并在MODS中注明原始摄影师。
安装
使用composer下载此模块、其功能和其依赖项
composer require islandora/migrate_7x_claw
使用Drush同时安装模块和示例迁移
drush en islandora_migrate_7x_claw_feature
配置
默认情况下,迁移配置为与在同一主机上运行的islandora_vagrant
实例和claw-playbook
实例一起工作,这对于开发和测试来说很方便。但对于您的Islandora 7.x实例,以下配置需要在每个迁移的源插件中以相同方式设置(除了“7.x Tags Migration from CSV”迁移)
管理页面
/admin/config/islandora/migrate_7x_claw
请阅读“命令行配置”部分以了解输入值描述和目的。保存后,您可以运行迁移组任务(admin/structure/migrate/manage/islandora_7x/migrations)
可选
要验证保存的更改,请转到admin/config/development/configuration/single/export
- 配置类型:迁移组
- 配置名称:以下每个都应反映给定的值。
- migrate_plus.migration.islandora_audit_file
- migrate_plus.migration.islandora_audit_media
- migrate_plus.migration.islandora_corporate
- migrate_plus.migration.islandora_files
- migrate_plus.migration.islandora_geographic
- migrate_plus.migration.islandora_media
- migrate_plus.migration.islandora_objects
- migrate_plus.migration.islandora_person
- migrate_plus.migration.islandora_subject
命令行配置
solr_base_url
应指向您的Islandora 7.x Solr实例(例如,http://example.org:8080/solr
)fedora_base_url
应指向您的Fedora 3实例(例如,http://example.org:8080/fedora
)- 在块中为您的Fedora 3实例指定的用户名和密码
plugin: basic username: fedoraAdmin password: fedoraAdmin
q
用于定义一个Solr查询,该查询选择要迁移的对象。从新克隆的版本开始,迁移配置为使用以下查询查找islandora:sp_basic_image_collection
及其所有子项:RELS_EXT_isMemberOfCollection_uri_ms:"info:fedora/islandora:sp_basic_image_collection" OR PID:"islandora:sp_basic_image_collection"
您可以通过更改上述查询中的PID轻松导入自己的集合,或者您可以为以其他方式迁移对象(例如按内容模型、按创建日期排序等)提供自己的查询。如果您可以编写Solr选择查询,则可以将它迁移到Islandora 8。省略配置中的q
将默认为Solr查询的*:*
。
一旦更新了配置,您需要重新导入功能来加载您的更改。您可以使用drush
来完成此操作。
drush -y fim islandora_migrate_7x_claw_feature
如果转到admin/config/development/features
并点击“迁移7x爪子功能”旁边的“更改”链接,您也可以使用UI来导入功能。
从那里,您可以选择所有更改并点击“导入更改”。
运行迁移
您可以使用drush
快速运行所有迁移。
drush -y mim --group islandora_7x
如果您想通过UI进行操作,可以访问admin/structure/migrate
来查看迁移组列表。此模块提供的迁移的机器名为islandora_7x
。
您将看到8个迁移。 “从CSV迁移7.x标签”需要首先运行。
点击“7.x标签迁移从CSV”迁移的“执行”按钮会显示一个类似页面
您可以针对迁移执行的操作有
- 导入 - 导入未迁移的对象(勾选“更新”复选框可重新运行之前已迁移的对象)
- 回滚 - 删除之前导入的所有对象(如果有的话)
- 停止 - 停止长时间运行的导入。
- 重置 - 重置可能失败的导入。
如果您选择“导入”,然后点击“执行”,它将运行迁移。它应该处理5个项目。
然后您可以运行“Islandora媒体”迁移,它依赖于剩余的迁移。运行它实际上运行了除“从CSV迁移7.x标签”以外的整个迁移组。完成后,您应该能够导航到您的Islandora 8实例的主页,并看到从Islandora 7.x迁移过来的内容!
如果您点击任何节点,您应该能看到其所有元数据,这些元数据已从其MODS和Solr文档中提取。这是Islandora 7.x中的原始对象
这是Islandora 8中的样子
点击媒体标签将显示从7.x迁移过来的所有数据流,您现在可以通过Islandora 8进行管理。这是Islandora 7.x中的原始数据流
这是Islandora 8作为媒体中的样子
您还可以查看集合本身,其“成员”块应该已填充
迁移是如何工作的
您提供一个查询,作为源插件配置中的q
,来定义哪些对象将被迁移。对于查询中的每个结果,您可以选择使用对象的Solr文档、对象的FOXML文件或通过设置url_type
配置的特定数据流来使用对象。主题、地理和代理的迁移都针对对象的MODS文件。数据流的迁移使用FOXML,而对象的迁移使用Solr文档。
所有数据流都按原样迁移,无论迁移提取了哪些数据并将其作为字段应用。
只要所有集合都在q
查询结果中,集合层次结构就会得到保留。
MODS中的主题、地理和人/法人代理都会转换为分类术语,内容将使用这些术语标记。
高级Drush命令
用于处理迁移过程的有用drush命令。
导入命令
此命令从命令行启动导入过程,并指定用户名和操作。
$ drush --uri=https://:8000 --userid=1 -y migrate:import --group islandora_7x --update └─────────────────────────┘:└────────┘└─┘ └────────────┘ └──────────────────┘ └──────┘ URL of Islandora 8 ───┘ │ │ │ │ │ User Numeric ID ──────────────────────┘ │ │ │ │ send yes to confirmation(optional) ────────────┘ │ │ │ Module and action ──────────────────────────────────────┘ │ │ Group name ──────────────────────────────────────────────────────────────┘ │ Update existing objects(optional) ────────────────────────────────────────────────────────┘
控制迁移
$ drush migrate:rollback --update --limit="1000 items" --feedback="20 items" islandora_audit_media └─────┘:└──────┘ └──────┘└───────────────────┘ └───────────────────┘ └───────────────────┘ Module Name ┘ │ │ │ │ │ Action ────────────┘ │ │ │ │ confirmation(optional) ──────┘ │ │ │ Number of unprocessed items to run ──────┘ │ │ Number of items to display after completed ─────────────────────┘ │ Migration Step ────────────────────────────────────────────────────────────────────────┘
操作
- 导入
- 回滚
- 停止
- 重置
迁移步骤
- islandora_7x_tags
- islandora_audit_file
- islandora_audit_media
- islandora_corporate
- islandora_files
- islandora_geographic
- islandora_media
- islandora_objects
- islandora_person
- islandora_subject