Used for migrate multiple databases fron old mysql instance to new instance.
Warning: this sh script will drop db in new mysql instance. You can modify the drop
line in migrate.sh
-
open
migrate.sh
, modify old/new mysql instance configuration, modify("db01" "db02")
to your db names. -
run
migrate.sh
, over.
Internal logic:
- dump db from old instance to local disk as
.sql
file - drop corresponding db in new instance
- create corresponding db in new instance
- restore tables/data to db in new instance
If want to get db names/size in old instance, app.js
, package.json
are needed.
-
open
app.js
, modify mysql configuration. -
run query:
npm install
node app.js