Question

So far all the examples of converting a SQLite2 database to SQLite3 or MySQL all answers assume that the person has access on their computer to the tools needed to do this conversion or access to specific folders on a webserver host.

Can someone actually give a working answer that will allow someone who is using a web host on a shared server to convert or export the contents of an SQLite2 database to a SQLite3 or MySQL database please?

I have a webserver on my PC and PHP but the version of PHP that I have does not support SQLite2 so I am stuck because you have to use this particular version of PHP with the webserver, I can't just swap it out for another version, my options appear to be with doing the conversion on the webserver.

Help in solving this issue would be appreciated.

Was it helpful?

Solution

You don't need PHP to convert a database. Download:

  1. SQLite 2.8 from https://www.sqlite.org/sqlite-2_8_17.zip
  2. SQLite 3.2 from https://www.sqlite.org/2013/sqlite-shell-win32-x86-3080200.zip

Decompress both in a folder. Assuming your DB file is called old.db, put it in the same folder as the two executables, navigate to the folder with cmd.exe and run the following command:

sqlite old.db .dump | sqlite3 new.db

as recommended in the SQLite 3.x announcement. new.db will contain the same data in 3.x format.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top