You can use the sqlite3 .dump .dump to output dump output to another db. It takes an optional argument with the name of the table.
db1=~/mydb1.sqlite db2=~/mydb2.sqlite t=t2 sqlite3 "$db2" ".dump $t" | sqlite3 "$db1"
If you do not have common tables in both databases, you can leave the table name and copy all the tables.
If the tables are large, this can be slow because INSERT will do this. If they are huge, and it is really too slow, perhaps .import will be faster. You can try something like
sqlite3 "$db2" ".schema $t" | sqlite3 "$db1" sqlite3 "$db2" "SELECT * FROM $t" | sqlite3 "$db1" ".import /dev/stdin $t"
mivk
source share