Page 1 of 1

CSDB to SQL Database

Posted: April 26th, 2024, 7:15 am
by munirmdee1
Hello hi CSPro Users,

I have a CSDB file, I need to query all records from it and Insert into Relational database like Maria DB. How do I perform this locally?

I have a "Transportation.csdb", which contains all information about transportations collected from the field, now I need to write a logic or sql script to fetch all the data and insert into Maria DB table called Transportations. How do I do it?

I need help please, Thanks in advanced.

Re: CSDB to SQL Database

Posted: April 26th, 2024, 8:51 am
by htuser
Hi Munirmdee1,
In the past, I used several ways to perform this, among others, for CSLog:

a) A direct and easy way was to use an existing GUI version of this Python package (https://github.com/techouse/sqlite3-to-mysql) that was from this user: https://github.com/ArefDev (Please see the attached PDF file)
Docs.pdf
(509.68 KiB) Downloaded 16 times
). For copyrighting reasons, the repository containing the GUI version of the package has been deleted by Aref. However, you can still use the command line version from the owner of the package: Klemen Tusar (Techouse).

b) Installing CSWeb on Internet, LAN or local computer with MariaDB as database server and Sync the CSDB file to CSWeb. After, you can use this guide: https://www.csprousers.org/help/CSWeb/d ... tings.html to process case to your MariaDB database and having the your whole CSDB transferred to MariaDB.

c) Before CSDB and Before Greg shared a tool, MyCSPro, with me in 2012, I used some tools such as: https://dbconvert.com/ and some workarounds to send legacy *.dat file to MySQL. This tool can be also used to transfer SQLite files (CSDB) to MariaDB. Similar tools can be downloaded here: https://www.jetbrains.com/datagrip/?var=light
Hope this help you!

Re: CSDB to SQL Database

Posted: May 1st, 2024, 1:59 pm
by Gregory Martin
The CSPro DB file is a SQLite file, so you can open that file in a program such as DB Browser for SQLite and then export the database. (In that tool, you select File -> Export -> Database to SQL file.) Then you should be able to import that SQL file in MariaDB.

Re: CSDB to SQL Database

Posted: May 2nd, 2024, 3:19 am
by munirmdee1
@htuser

Thank you very much, this will help

Re: CSDB to SQL Database

Posted: May 2nd, 2024, 3:20 am
by munirmdee1
@Gregory Martin

Thank you Greg, will work on that too