From:       To:      

Home > Documentation > SQLite to MySQL

Command Line Version of SQLite to MySQL Converter

To perform batch conversion or call conversion procedure from an automation script you can use console version of SQLite to MySQL converter called L2SAGENT.EXE. Find this file in the installation folder. You can either run this tool directly from command line or call it from any script as well. The program supports the following command-line options:

--dest=...   MySQL database or dump file name
--dump   convert SQLite database into MySQL script file
--help   display help message and exit
--logfile=...   path to the logfile where execution traces will be written
--mode=...   how to process an existing MySQL database (0 - overwrite the entire database, 1 - overwrite existing tables only, 2 - skip existing tables, 3 - merge)
--mysqlh=...   MySQL server IP address or network name
--mysqlu=...   MySQL user name
--mysqlp=...   MySQL user password
--port=...   MySQL port
--profile=...   path to a profile to load conversion settings from
--silent   use this option to disable program output
--src=...   path to SQLite database
--tab_def   convert table definitions only
--tab_file=...   file containing table names to convert (one table name per line)

In the following example the program converts SQLite database located in "c:\db 1.sqlite" folder into MySQL database "db 1" on the remote MySQL server "mysqlhost":

L2SAGENT.EXE --src="c:\db 1.sqlite " --dest="db 1" --mysqlh=mysqlhost --mysqlu=administrator 
--mysqlp=the_passsword

Notes:

  1. You can omit 'mysqlh' parameter to connect local MySQL server
  2. It is necessary to specify 'port' parameter only if it differs from the default MySQL port 3306
  3. If you omit 'tab_file' parameter, all database tables will be converted
  4. If you omit 'mode' parameter, default mode 'overwrite the entire database' will be used
  5. Command line parameters that contain spaces should be enclosed in quotes (for example --dest="my database")

Have any questions? Contact us