I have 3 sqlite3 database files, from 170G to 1.07T on my CentOS 7 sever. I can create dump files by sqlite3 logs.db .dump > logs.sql but these sql files can't be imported to MySQL because of syntax.
I've read these solutions:
Quick easy way to migrate SQLite3 to MySQL?
http://www.sqlite.org/cvstrac/wiki?p=ConverterTools
http://www.redmine.org/boards/2/topics/12793
https://realpython.com/blog/python/web2py-migrating-from-sqlite-to-mysql/
https://github.com/athlite/sqlite3-to-mysql
I tried some of them but it seems not working. I don't have enough memory for the string searching and replacement.
Is there some effective way for large sqlite databases to be migrated?
Apparently I didn't use all the scripts in http://www.redmine.org/boards/2/topics/12793, I only used the latest script by Peter sørensen and it can't handle big files as the console returned "Killed". I guess it has something to do with the temp file operation.
My problem was solved by Pavel Medvedev's script. Although Peter's post says that the updated script deals with "a problem where not all was converted to the correct mysql value when a sting stretched across multiply lines". My sql files have multiple lines of string and Pavel's script can handle it. There's no problem. Maybe the problem Peter mentioned would occur with someone's files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With