As D1, a sqlite-compatible DB from Cloudflare, is limited to a maximum of 10GB, I needed to migrate my database to one that is famously capable of handling a numerous number of rows.
To export it I used the wrangler CLI:
npx wrangler d1 export my-db --remote --output="db.sql"