temori/distancexport
Composer 安装命令:
composer require temori/distancexport
包简介
Data migration tool that can migrate data between databases with different structures.
README 文档
README
Data migration tool between databases.
Data migration is possible regardless of RDB.
Table of Contents
Features
-
Database data migration tools.
-
Data migration between two databases is possible.
-
Migrate the data in the source column in the same row as the destination column in a web like Google Spreadsheet.
-
The default only supports Mysql and pgsql drivers.
If you want to use another driver, you can add a driver classes.
Requirements
- php 5.4 or later
Installation
Using composer:
cd path/to/your/project
composer require temori/distancexport --dev
Usage
-
Create a php files.
If you use any FW, Create a routable controllers.
-
Define the following constants.
- For the destination DB.
DX_DESTINATION_DB_DRIVERdestination DB drivers.DX_DESTINATION_DB_HOSTdestination DB hosts.DX_DESTINATION_DB_PORTdestination DB ports.DX_DESTINATION_DB_USERNAMEdestination DB accounts.DX_DESTINATION_DB_PASSWORDdestination DB passwords.
- For the source DB.
DX_SOURCE_DB_DRIVERsource DB drivers.DX_SOURCE_DB_HOSTsource DB hosts.DX_SOURCE_DB_PORTsource DB ports.DX_SOURCE_DB_USERNAMEsource DB accounts.DX_SOURCE_DB_PASSWORDsource DB passwords.
- When need csrf tokens.
DX_CSRF_TOKEN_NAMECSRF token name fields.DX_CSRF_TOKENCSRF token fields.
- For the destination DB.
-
Create an instance of
\Temori\Distancexport\Distancexportwith the created php file or controller and execute theinit()method,like below.
$dis = new \Temori\Distancexport\Distancexport(); $dis->init();
-
If you use a FW that requires routing settings, you need to create the routes
getandpost. -
Open the above php file or controller url.
-
Since table names, data types, key types, etc. are lined up like a spreadsheet, copy and paste the column name you want to migrate next to the migration destination database column.
The columns required for migration are
FieldinDestination DatabasesandFieldinSource Databases.Data migration is ignored if
FieldinSource Databasesis blank.If you enter a character string in the
Uniformitycolumn as an option, the character string described inUniformitywill be added to all records. -
The
Dry runbutton performs test execution, and theRunbutton executes data migration.If an exception occurs, an error message will be displayed in
Resultsandmessage.
Supported RDB driver types
- Mysql
- postgresql
Add RDB driver
If you want you can add other driver classes.
For the class to be created, implement the BaseDriver class and inherit the Connect class.
In addition, create a method that produces the same execution result as the following class.
Specify the driver class added when creating the instance as shown below.
$dis = new \Temori\Distancexport\Distancexport(\Some\NameSpace\DestinationDriverClass::class, \Some\NameSpace\SourceDriverClass::class);
Note
[warning]
Since the entire database structure is displayed, please be careful about security when using it.
License
Paddington is licensed under the MIT license.
Copyright © 2020, Atushi Inoue
temori/distancexport 适用场景与选型建议
temori/distancexport 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 10 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 temori/distancexport 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 temori/distancexport 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-27
