N
Neon•7d ago
passive-yellow

How To Import Correctly?

I recently started a branch and used the development function. I now have 2 different databases entirely thanks to being a novice an vibe coding. How do I merge or update the production one with the informatin from the development one. Cursor has failed at this and I'm a few hours into what seems like a pretty basic request.
6 Replies
correct-apricot
correct-apricot•7d ago
Hey! You can restore prod from your dev database to essentially overwrite prod with it. However, this is not what I would recommend. You should instead apply whatever migrations you applied to dev, to prod. That way you can keep a nice branch hierarchy 🙂
passive-yellow
passive-yellowOP•6d ago
I saw your almost exact post on this and was confused (which prompted the question). Are you saying, "whatever you did to get the dev db in that state, do it to production?"
correct-apricot
correct-apricot•6d ago
Yeah basically. It's best to track database changes through migration files, then you simply apply the migration to the production database. What stack are you using?
passive-yellow
passive-yellowOP•6d ago
Astro, Tailwind, Cloudflare Pages, Neon. I was adding an "ecommerce-like" branch and was using AI agents to help build it in the background. The agents couldn't "see" the production db so they made up their own with the creds I gave them fo rthe development one.
correct-apricot
correct-apricot•5d ago
Are you using Drizzle? If so, running migrations to update your production database is very simple. When developing locally, you’re working against a dev branch of the database. Any changes you make to the Drizzle schema can be generated into a migration file, which you can then push to your production database (ideally through a CI pipeline). so, for your case, just generate the migration file of your current dev database, then apply it to your prod database 🙂
passive-yellow
passive-yellowOP•5d ago
No. I'll have to look at Drizzle!

Did you find this page helpful?