Search code examples
sqlsqlitedbeaver

How to insert data from one Sqlite database to another using SQL query?


I'm running a Minecraft server and trying to move datas from the plugin AuthMe to limboAuth. Now I have the authme.db file storing player information. Based on the introduction on the limboAuth site, I should run the SQL script

INSERT INTO limbo.AUTH SELECT realname, username, COALESCE(password, ""), COALESCE(ip, ""), COALESCE(totp, ""), regdate, "", "", NULL, NULL, NULL FROM authme.table WHERE username IS NOT NULL

I tried to run this script with DBeaver (though the scripts seems only run on one file but not globally). Anyway, I can't execuate it since I don't have the database limbo.db and table limbo.AUTH.

[SQLITE_ERROR] SQL error or missing database (no such table: limbo.AUTH)

I created a file limbo.db but can't generate a empty table limbo.AUTH. I think I'm understanding the instruction wrongly but not sure what should I do. Also, how can I open two database at the same time. I see people are using ATTACH but I don't think it works in the DBeaver.


Solution

  • I see people are using ATTACH but I don't think it works in the DBeaver.

    It does (but note the use of the full path, not just the database name)

    enter image description here