temori / distancexport
Data migration tool that can migrate data between databases with different structures.
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
pkg:composer/temori/distancexport
Requires
- php: >=5.4
- phpunit/phpunit: ^4.8
Requires (Dev)
- vlucas/phpdotenv: ^5.2
This package is auto-updated.
Last update: 2025-10-05 11:38:44 UTC
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
