Page 1 of 1

How to make .db files? (Solved)

Posted: Tue Mar 12, 2024 1:06 am
by Tippe

Hi.

I can use UEXTRACT to unpack/extract a .db file.

In my example use it unpacks a .sql file.
I want to edit this file manually.
After editing I want to pack it again into a .db file.

How do I do this?

Thanks


Re: Question about .db files

Posted: Fri Mar 22, 2024 6:36 pm
by vtpup
Tippe wrote: Tue Mar 12, 2024 1:06 am

Hi.

I can use UEXTRACT to unpack/extract a .db file.

In my example use it unpacks a .sql file.
I want to edit this file manually.
After editing I want to pack it again into a .db file.

How do I do this?

Thanks

Many different programs create ".db" extension named files, (it's a common name but not a standard format) and these can take many different proprietary formats. For anyone to answer this, you would have to specify which program and version you are trying to modify .db files for, and then find information about what specific file format that is, then find an application that will write your .sql modified files back to that format.

If it's possible to edit directly in the .db file itself without conversion to .sql, that might actually be easier. That would be possible if the files are ASCII text files, and you understood the format requirements, or if there was a dedicated editor that could handle them. Answering this will all probably take some online research on your part, unless somebody here has experience with your program and its formats.


Re: Question about .db files

Posted: Sat Mar 23, 2024 1:48 pm
by Tippe

Hi, and thanks for the reply.

It is the .db file from FreetuxTV.
FreetuxTV has lots of TV and Radio stations that doesn't work anymore.
My intention was -at least- to sort out the not working German TV and Radio stations
and to remove them from the .sql file, which is editable in Geany for example.
After that I wanted to rebuild the .db file, so it will be accepted by FreetuxTV.

FreetuxTV has no option to delete single stations, only groups of stations can be removed. :(

Again, thanks.


Re: How to make .db files? (Solved)

Posted: Mon Mar 25, 2024 11:42 pm
by vtpup

I see you marked this thread "Solved" so was there a solution?


Re: How to make .db files? (Solved)

Posted: Tue Mar 26, 2024 1:08 am
by Tippe
vtpup wrote: Mon Mar 25, 2024 11:42 pm

I see you marked this thread "Solved" so was there a solution?

No, i didn't mark this as "Solved". :(


Re: How to make .db files? (Solved)

Posted: Tue Mar 26, 2024 1:20 am
by vtpup

Weird!


Re: How to make .db files?

Posted: Tue Mar 26, 2024 1:20 am
by vtpup

Looks like an unidentified moderator has interfered with the title -- this has happened to me as well, and it's extremely irritating!


Re: How to make .db files?

Posted: Tue Mar 26, 2024 1:24 am
by vtpup

Looks like an unidentified moderator has interfered with the title -- this has happened to me as well lately, and it's extremely irritating!


Re: How to make .db files?

Posted: Tue Mar 26, 2024 1:25 am
by vtpup

Something weird is going on duplicating my posts as well.


Re: How to make .db files?

Posted: Tue Mar 26, 2024 1:47 am
by MochiMoppel
vtpup wrote: Tue Mar 26, 2024 1:25 am

Something weird is going on duplicating my posts as well.

Not a duplication.
Apparently you tried to edit your post 4 minutes later but created a new post instead:
"Looks like an unidentified moderator has interfered with the title -- this has happened to me as well lately, and it's extremely irritating!"


Re: How to make .db files? (Solved)

Posted: Wed Mar 27, 2024 1:53 pm
by vtpup

Sorry if the double post was something I did inadvertently, this new laptop's touchpad is problematic and overly sensitive and I occasionally brush it causing unintended results.

But, this thread's title wording and the addition of the (Solved) to the title had nothing to do with me, and apparently the OP did not do that either.

I have also had other thread titles changed recently, without notice, and anonymously. I assumed it was a moderator's change. I'm a moderator on other fora and elsewhere, unless someone's post is in clear violation of a rule, we don't change a post in any way without first contacting them, giving a reason for a any non-rule desired change and allowing them to make any requested change themselves. This is respectful to contributors who are not breaking any rule.


Re: How to make .db files? (Solved)

Posted: Wed Mar 27, 2024 2:34 pm
by JakeSFR

If UExtract was able to "unpack" it, it was just an SQLite database.

To dump database to an SQL file:

Code: Select all

sqlite3 input.db .dump > output.sql

To do the opposite and turn an SQL file back into database:

Code: Select all

sqlite3 output.db < input.sql

Greetings!


Re: How to make .db files? (Solved)

Posted: Fri Mar 29, 2024 2:41 pm
by Tippe

Hi.

@JakeSFR

Made a quick test:

Code: Select all

sqlite3 input.db .dump > output.sql

Doesn't work. Returns/extracts only this:

Code: Select all

SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
sqlite> 
sqlite> 

When extracting with Uextract it returns a file with 1213 lines of XML code.

But this one works:

Code: Select all

sqlite3 output.db < input.sql

It returns a .db file which seems to be loaded properly by FreeTuxTV, even though it is a bit smaller in Kb.
40 Kb compared to 104 Kb after re-packing with sqlite3.

Thanks! :thumbup:

I think this is solved now for real.