Subject: Conversion from CSV to sql

Posted on: 18/04/10 05:46pm
By: Anonymous

Hi
sometime ago I exported the full database of my geeklog website into a csv file
now i'd need to import it again into a new geeklog database, but phpmyadmin only accepts
sql files as input.
How can I reconvert the original db to sql?
any help would be appreciated
Cheers
Antonio

Re: Conversion from CSV to sql

Posted on: 24/04/10 06:40am
By: Anonymous

Hi
I just would like to add, that I can't, right now do a full back-up of my web
because it is down, and the actual host provider has forbidden execs() on the data base for (apparently) security reasons.
So it would be important for me to rebuild the DB from what I have, which is an older CSV file.
Any help would be appreciated
Cheers
Antonio

Re: Conversion from CSV to sql

Posted on: 24/04/10 08:55pm
By: suprsidr

Google search reveals http://www.codewalkers.com/c/a/Database-Code/CSV-to-SQL-convertor/

-s

Re: Conversion from CSV to sql

Posted on: 25/04/10 12:11pm
By: Anonymous

Hi
thanks, but the cuestion is that the geeklog DB has many different tables and the data in CVS files are "flat" data, without the table reference information.
So how do I feed the correct data to the correct table? How can I tell the converter where one table data starts and finishes?
all the best
Antonio

Re: Conversion from CSV to sql

Posted on: 26/04/10 08:06am
By: suprsidr

I just did a test export to cvs on a small development gl site.
Exporting one table at a time would have been the preferred method for cvs.

After adjusting the php on the above tool so it would work w/ php5 it looks promising for creation of sql inserts.
But you'll have to separate and name the tables yourself which certainly won't be easy.(Using an editor that knows what the line breaks are like Eclipse makes it a bit easier)
As I said - separating the tables at export would have made things easier.

You'll also likely need the same version of gl database for insert as well. Newer gl has extra columns for many key tables.

So to re-cap:


Whew!
Worth it?

-s


Re: Conversion from CSV to sql

Posted on: 26/04/10 12:34pm
By: Laugh

Quote by: antonio

Hi
sometime ago I exported the full database of my geeklog website into a csv file
now i'd need to import it again into a new geeklog database, but phpmyadmin only accepts
sql files as input.
How can I reconvert the original db to sql?
any help would be appreciated
Cheers
Antonio



Actually phpMyAdmin does accept csv file to import data but not for the entire database just for individual tables. Click on a table and then click the import tab to see all the options avaialble. So if your csv file contains data for all the tables you will have to manually break up the one file into a file for each table.

Re: Conversion from CSV to sql

Posted on: 25/04/18 11:51am
By: Anonymous

The quickest way is to use a conversion tool like SQLizer.io.

It’ll convert xlsx, xls, or csv to SQL in seconds and give you properly formatted table and INSERT data. It’ll literally save you hours over manually doing it or writing a script.

You can also convert XML and JSON files with SQLizer.

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=90227