sqlite3 -escape off server/db/db.sqlite .dump > db.sql
Escape off prevents unistr in newer versions of sqlite, which D1 does not support.
- Remove
BEGIN TRANSACTION;andCOMMIT;from the file - Remove
PRAGMAstatements - Remove
sqlite_sequencetable creation if exists - Remove all table creations, if tables are already created
- Remove index creations, if indices are already created
- Remove migrations table (like
__drizzle_migrations) value inserts, if migration is already run
pnpm wrangler d1 execute <d1-database-name> --remote --file=db.sql