Learn how to migrate a Next.js app from Vercel + PlanetScale to Fly.io. The article provides a step-by-step guide on deploying the app and MySQL database to Fly.io. It also explains how to set up Cloudflare for non-www to www redirection.

8m read time From crispyscript.com
Post cover image
Table of contents
What does the result look like?Step 1: [MySQL] Initialize Fly.io setup for MySQLStep 2 (Optional): [MySQL] Set up auto start/stop featureStep 3: [MySQL] Create a volumeStep 4: [MySQL] Add sensitive env variables into fly secretsStep 5: [MySQL] Deploy MySQL to Fly.ioStep 6 (Optional): [PlanetScale Migration] Migrate data from PlanetScale to MySQL (in Fly.io)Step 7: [Next.js] Initialize Fly.io setup and set NEXT_PUBLIC_* env variablesStep 8: [Next.js] Set up remaining env variablesStep 9: [Next.js] Install sharpStep 10: [Next.js] Deploy the Next.js app to Fly.ioStep 11: [DNS] Set up Cloudflare to redirect non-www to www URLFinal ResultNext Steps
2 Comments

Sort: