Download the PHP package ctf0/mysql-to-mongodb without Composer
On this page you can find all versions of the php package ctf0/mysql-to-mongodb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ctf0/mysql-to-mongodb
More information about ctf0/mysql-to-mongodb
Files in ctf0/mysql-to-mongodb
Package mysql-to-mongodb
Short Description A Console Commands To Help With Data Migration From mysql To mongodb.
License MIT
Homepage https://github.com/ctf0/MysqlToMongoDb
Informations about the package mysql-to-mongodb
Mysql To MongoDb
I made this tool as i was starting to learn mongodb and i couldnt find any decent alternative.
The tool is working as expected and even tested on a live working app that uses mysql, however i strongly recommend that you use this package with a grain of salt.
Installation
-
composer require ctf0/mysql-to-mongodb
- (Laravel < 5.5) add the service provider
Usage
Notes
- if you havent installed mongodb yet, check http://wp.me/p4DYee-9Q
- make sure that you can connect to both of your dbs through laravel without any issues.
- the package assume that your mysql driver connection is
mysql
and your default driver connection ismongodb
. -
the package doesnt recreate the table types from
mysql
, and its up tomongodb
to decide at that point, however currently the below types gets converted on migrationtinyint(1) => bool
timestamp => date
multi(OneToMany) => index
-
unique => index/unique/sparse
having a field with the same name in 2 different collections will give an error, so as a-way-around the index is saved as (CollectionName_field)
- all your app calls to
id
should be changed to_id
except in view which is automatically converted through the model. moloquent
usestring
for the relation linking/referencing, so when converting the foreign_ids toObjectId
now you will havestring
on one side andObjectId
on the other which will cause lots of trouble, so its kept as string.
ToDo
- Find Away To Add Data In Bulk Instead Of One By One.
- Upload Db Backup To S3.
- Make A Small GUI For Easier Migration.