humanmade/hm-content-import
Composer 安装命令:
composer require humanmade/hm-content-import
包简介
Migration framework for WordPress
README 文档
README
Migration framework for WordPress, attempts to reduce overhead in migrating content from differing data sources
Introduction
HMCI is an extensible, performant, scriptable, pausable, resumable, and horizontally scalable WP-CLI framework for importing large amounts of content into WordPress. It is a base framework for performing custom migrations of large amounts of content from any source and therefore requires the development of an import handler for each type of content being imported.
It typically supports both new imports and delta imports, although this is dependent on the individual import handlers written for each migration.
HMCI can be run in multiple threads in parallel, making it horizontally scalable in order to reduce the time required to process large imports. It has been used as the basis of large data migrations for Human Made clients such as The Sun, L'Express, Capgemini, and others.
Ingestion
HMCI supports ingestion of data via iterators that support:
- Single files
- CSV
- JSON
- Directories of files
- JSON
- XML
- A direct MySQL database connection
- WordPress Posts (for internal migration)
Insertion
HMCI supports inserting imported data into:
- WordPress
- Attachments
- Comments
- Guest Authors (used by Co-Authors Plus and PublishPress)
- Posts
- Taxonomy Terms
- Users
- Files
- CSV
Importing
See the Running Imports for more information on how to import data.
Writing Importers
See the Writing Importers for more information on how to write importers.
Migrating From Version 1
In Version 2 we changed the way canonical IDs are stored. This means that you will need to migrate your existing data to the new format, if you are planning to resume / to delta imports with data that was imported under Version 1.
Run the following SQL query to migrate your existing data:
UPDATE wp_postmeta SET meta_key = CONCAT('hmci_canonical_id_', meta_value) WHERE meta_key = 'hmci_canonical_id'; UPDATE wp_usermeta SET meta_key = CONCAT('hmci_canonical_id_', meta_value) WHERE meta_key = 'hmci_canonical_id'; UPDATE wp_commentmeta SET meta_key = CONCAT('hmci_canonical_id_', meta_value) WHERE meta_key = 'hmci_canonical_id'; UPDATE wp_termmeta SET meta_key = CONCAT('hmci_canonical_id_', meta_value) WHERE meta_key = 'hmci_canonical_id';
Should you need to revert this migration, you can run the following SQL query:
UPDATE wp_postmeta SET meta_key = 'hmci_canonical_id' WHERE meta_key LIKE 'hmci_canonical_id_%'; UPDATE wp_usermeta SET meta_key = 'hmci_canonical_id' WHERE meta_key LIKE 'hmci_canonical_id_%'; UPDATE wp_commentmeta SET meta_key = 'hmci_canonical_id' WHERE meta_key LIKE 'hmci_canonical_id_%'; UPDATE wp_termmeta SET meta_key = 'hmci_canonical_id' WHERE meta_key LIKE 'hmci_canonical_id_%';
humanmade/hm-content-import 适用场景与选型建议
humanmade/hm-content-import 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 34.89k 次下载、GitHub Stars 达 29, 最近一次更新时间为 2019 年 03 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 humanmade/hm-content-import 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 humanmade/hm-content-import 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 34.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 29
- 点击次数: 23
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2019-03-04