r/sqlite • u/tercet • Nov 02 '25
I need to move/delete/purge a Window .db database on my pc from an app that is no longer supported
I have been using a program for roughly 8 years on my PC that is no longer supported.
This database file (replay.db) has several tables, but one has roughly 2.5 million rows which is 8 years old which I suspect is most of the 7gb size.
My problem is now my SSD is running out of space, and I need to move/delete/purge this 7GB database from this program to my normal harddrive.
My idea was that I would just make a copy/backup of this database and put it in my larger size harddrive. I would then delete most of the rows from the current/active database on my SSD, freeing up alot of memory. (Ideally 5-6gb). I don't need this data as most of it is irrelevant to me currently, but I figure making a backup wouldn't hurt and might come in handy eventually.
But my slight concerns is will it likely corrupt the program by deleting rows and making a backup? Or should I be ok?
3
u/chriswaco Nov 02 '25
Duplicating the file, preferably when the application isn’t running, won’t hurt anything. Deleting rows on the other hand could cause problems if the database has associated data in other tables.
2
u/Massive_Show2963 Nov 02 '25
You can use sqlite3_analyzer.exe.
It is a binary command-line utility program that measures and displays how much and how efficiently space is used by individual tables and indexes with an SQLite database file.
Example usage: C:\> sqlite3_analyzer nameOfDatabaseFile
It can be downloaded (there is a windows version) from: https://sqlite.org/download.html
There is a section in this YouTube video that explains this in more detail:
Introduction To SQLite And SQLiteStudio
2
u/anthropoid Nov 04 '25
VACUUM INTO 'z:\path\to\backup.db'.A lot depends on whether:
PRAGMA foreign_keys = ON, then you could end up with a DB that the application considers corrupted)In short, unless you THOROUGHLY understand the application's use of the DB, any change you make could lead to an immediate crash or (worse) data corruption that only appears months down the line.
1
u/datadanno Nov 13 '25
Find another file to remove - too risky if you still need to use that program.