MySQL/migration/CLI

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
MySQL migration using CLI

About

There are two parts to the migration process: exporting data (generating an importable file from the source database server) and importing data (converting a file into a database on the server).

  • Export: There is a utility program, mysqldump, which is specifically for handling this task. (It may be possible to replicate everything it does via SQL, but there's a lot of information in comments, and perhaps even pragma-code, which would be difficult to replicate precisely; I'm not sure if this is documented anywhere.)
  • Import: This is basically just running mysql from CLI and then piping in the entire contents of the exported .sql file.