- Install https://pgloader.readthedocs.io/en/latest/install.html
- Dump your D1 Database,
npx wrangler d1 export <database_name> --remote --output=./d1_dump.sql - Import into your_database.db,
sqlite3 your_database.db < d1_dump.sql - Load into PG,
pgloader sqlite:///path/to/file.db pgsql://pguser@pghost/dbname