Migrating away from Planetscale (expiring hobby plan)

Due to Planetscale deprecating their hobby plan, I'm taking a very basic database of my hobby project and seeking to move it over. I've seen Supabase recommended, but the transfer of Planetscale's MySQL base to Supabase's Postgres is a nightmare for something that should be very simple. For those of us that just want an easy migration, does anyone know of the most pain-free experience to migrate data?
10 Replies
GuiSiebert
GuiSiebert3mo ago
I used Railway and it worked pretty easy (: And if your app is really basic, the $5 credit they give you, should be enough for a longtime (especially if you activate the auto sleeping functionality)
Circus
Circus3mo ago
Uhh...what? Railway is used for deploying applications and I'm already on Vercel, so this seems like odd advice. Can you expland on what you mean or what you did?
GuiSiebert
GuiSiebert3mo ago
I'm also on Vercel. Using Railway just for my db. Am I allowed to post links here?
Ruiisuuu
Ruiisuuu3mo ago
I just use Amazon RDS free tier, since I already use AWS for long running tasks
derfcode
derfcode3mo ago
I’ve been trying Supabase, but there’s a bit of learning curve for me now. Supabase and prisma don’t work well together. Supabase Auth has obv been a bit too learn since I was just using clerk before.
Circus
Circus3mo ago
Yeah I saw this but like with other tutorial videos, they don't go over common errors. What did you do with mysql when/if you got this error?
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
Abuzeid
Abuzeid3mo ago
If you are using Prisma or any ORM; You can easily export your data to a json file; Then upload it to any db provider of your choosing; in my case it was neon Pulling Script
await prisma.*model.findMany().then(async (val) => {
await Bun.write("*./file.json", JSON.stringify(val));
});
await prisma.*model.findMany().then(async (val) => {
await Bun.write("*./file.json", JSON.stringify(val));
});
Seeding Script example
await prisma.*model.createMany({ data: *importedFromJsonFile, skipDuplicates: true });
await prisma.*model.createMany({ data: *importedFromJsonFile, skipDuplicates: true });
In case you ran the seeding script multiple times.
skipDuplicates: true
skipDuplicates: true
Circus
Circus3mo ago
I don't know really what you mean and don't think this is relevant (respectfully). This is not an option in Railway. Are you saying to not use Railway?
Abuzeid
Abuzeid3mo ago
I guess I was not clear enough. I was trying to answer the first question about migrating off PlanetScale. As for Railway It is up to you and your needs. The Approach pulling your data from PlanetScale db and storing it in a json files in your local machine. Then using primsa to connect to a new one -any db that that support Prisma- seeding -populating- from the Json files.