What will be the best approach to save records from sqlite table to MySql? The table consist of 6 columns and at least 50k rows.
My initial idea is to convert the records into map or json file and use php script, but not really sure how to. Hope anyone here can help out.
That sounds like a LOT of data. If it is a high megabytes worth of data and if you have control over the backend pages (meaning you can develop your own pages on the server), one thought might be to zip the data on the device, then send/FTP the ZIP file to the server and have the backend unzip and import the data.
That sounds like a LOT of data. If it is a high megabytes worth of data and if you have control over the backend pages (meaning you can develop your own pages on the server), one thought might be to zip the data on the device, then send/FTP the ZIP file to the server and have the backend unzip and import the data.
you don't say how much access you have to either
database. in theory, you can dump your sqlite db to
a text file, zip it, upload the file to your php server and create
a table or db from the file. an sqlite dump should be readable
by mysql. sqlite is relatively compliant with sql standards. there
are lots of other possibilities, but they depend on where you
are in the chain of command.
if you only have access to a few canned php scripts from
which to choose, and if your only access to the sqlite db is
your phone, you're pretty reduced to uploading 50k records
1 by 1 to php.
you don't say how much access you have to either
database. in theory, you can dump your sqlite db to
a text file, zip it, upload the file to your php server and create
a table or db from the file. an sqlite dump should be readable
by mysql. sqlite is relatively compliant with sql standards. there
are lots of other possibilities, but they depend on where you
are in the chain of command.
if you only have access to a few canned php scripts from
which to choose, and if your only access to the sqlite db is
your phone, you're pretty reduced to uploading 50k records
1 by 1 to php.
To dump the selected sqlite table as text file and upload it to the server sounds okay. Just need to search the script for the php part. My idea was to convert the table records json file and upload it to the server and php code( I have access) will save it to the Mysql database but don't sure how to start and if it is better solution. I think uploading 1 by 1 will take too much time.
if this is a one-shot deal, 1 by 1 is probably the easiest for you. i'm guessing you already have a php script which allows create (and/or insert) from an app. this will entail nothing or very little to learn. take a nap, and it's over.
otherwise, you have to figure out how to "dump" sqlite to json (all on you to learn and test). then you have to figure out how to take a big json file and turn it into something php can convert to mysql. (again, on you to learn and test).
i don't have my slide rule handy, but i think it might take you longer to research, learn and test the necessary new tricks than if you just started uploading the records right now. just sayin'...
if this is a one-shot deal, 1 by 1 is probably the easiest for you. i'm guessing you already have a php script which allows create (and/or insert) from an app. this will entail nothing or very little to learn. take a nap, and it's over.
otherwise, you have to figure out how to "dump" sqlite to json (all on you to learn and test). then you have to figure out how to take a big json file and turn it into something php can convert to mysql. (again, on you to learn and test).
i don't have my slide rule handy, but i think it might take you longer to research, learn and test the necessary new tricks than if you just started uploading the records right now. just sayin'...