I have many different .sqlite database files (around 1000, even more), all with the same schema and I need to merge all of them into two sqlite files, as explained below.
The file names are "con_cookies_{domain.TLD}.sqlite" and "sin_cookies_{domain.TLD}.sqlite" so I would like to have "con_cookies.sqlite" and "sin_cookies.sqlite".
Which would be the best way to do it? I don't so much knowledge about sqlite so a bash script would be appreciated.
EDIT:
I share a screenshot with the DB structure. The primary key is not important if the order of the data is preserved. On the other hand, each file would have around 40-50 rows.
DB structure from source files Some SELECT {...} FROM rows example from source
UPDATE: DB schema in text format
id INTEGER PRIMARY KEY,
baseDomain TEXT,
originAttributes TEXT NOT NULL DEFAULT '',
name TEXT,
value TEXT,
host TEXT,
path TEXT,
expiry INTEGER,
lastAccessed INTEGER,
creationTime INTEGER,
isSecure INTEGER,
isHttpOnly INTEGER,
inBrowserElement INTEGER DEFAULT 0,
sameSite INTEGER DEFAULT 0,
Domain TEXT,
DurationDays INTEGER,
WebCategory TEXT,
CookieCategory TEXT,
Action TEXT,
TLD TEXT,
CMP_VENDOR TEXT,
CMP_IAB_V1 TEXT,
CMP_IAB_V2 TEXT,
Country TEXT,
CookiesByDefault,
CONSTRAINT moz_uniqueid UNIQUE (name, host, path, originAttributes));
CREATE INDEX moz_basedomain ON moz_cookies (baseDomain, originAttributes);
Also, if it's easier to do massive export of all the DBs to CSV would be also fine, instead of join all of them.