Remix an app uses the same database on new app as the old one

When you Remix (fork) an app that has a database currently, the new app that has been remixed (forked) uses the original app’s database.

This isn’t apparent in the ‘Database’ view of the new app, as it looks like there isn’t any database, however, from the Shell you can confirm this.

Ideally, the new remixed app would get its own database, or be transparent that this is not the case, and the new app should have its own database.

5 Likes

@jmangan1 mentioned he is seeing this and has reported to support.

1 Like

Not sure how long this would take to be fixed, but I have had luck with prompting the agent when starting the new remixed app: “Configure a new database attached to this version of the app.”

Also, (and I haven’t done this) I think there is a way to have a script written and run, so that when remixed/forked is first initialized, a new database is setup. But neither is done automatically currently.

2 Likes

There’s a bigger rework for databases in progress to do dev / prod and make it clearer what repls are using what databases. On Remix you can point back at the original database by setting the same environment variables in Secrets. Bunch of requests to set the database pane based on Secrets instead of a hard association of Repl to DB, which is going to be part of that larger restructuring.

4 Likes

Has this issue now been resolved. Is there a quick fix in the meantime?

1 Like

Hit remix, delete the database secrets in Secrets (database URL, etc), then create the new database in the Database pane to make a new one associated with the forked repl.

3 Likes

Holy crap I didn’t know this and almost wrecked a perfectly good app!

This is why we don’t want to make apps available for remix because we don’t want our database included. I thought this was something I was doing wrong but I’d love to have other orgs remix our app but not with our database attached to it. Does it also do that for API calls or will it make them put their own API key in?

I’m having the exact opposite problem, when I remix my app, it creates a new database instead of using the original database. Seems like a good opportunity for, and the need of, a button or selection that allows you to explicitly choose whether the old or a new database should be used.

Really? I find that neon/command tab has the db URL there, it cannot be changed, and it overwrites your secret db URL, host and pwd. So once your fork loses the db connection, it’s actually not possible to get it back. You have to import your data from original to new db. And pay neon for the privilege too.

If you remix as the owner of the app, it carries the secrets because you’re the owner.

If someone who isn’t the owner remixes, it doesn’t carry the secrets and they have to set their own values for them.

1 Like

Whenever I remix - I can’t view the old database even though I’m connected to it. In the Database tab I am prompted to create a new database. When I do that I get a blank database with no schema. Normally, the Agent can initiate and create the new database with proper schema, but it would helpful to 1) be able to connect and view the old database and 2) have an easier way to initialize the new one without have the Agent hit or miss on doing it. Sometimes it adds to the schema while making a new one.

1 Like

This is STILL a big fail on Replit (which is rapidly becoming my FAR preferred IDE over cursor, cline, FBS, and even Codex under a chatGPT pro subscription!

The issue is that a new fork does NOT carry the original db URL, and insists on creating a new db entirely. You can absolutely force your old db URL into the code (reconstruct it from the component secrets), but you lose the convenience of the data/db tab, and you cannot access this db directly thro Neon. So ur forced to copy across ur old db to the new, which is not the intention of a fork, not at all!

The data tab in replit has a ‘commands’ sub tab, with a db URL. If we could just edit that, I think it would solve everything. Replit team, please note!

PS: Guys, is this the main forum for replit users? Cos it feels awfully quite for a $3Bn app.

1 Like

Has the been any updates on being able to see the original database from the remix? This is making testing quite difficult :sweat_smile:

Really need an option on remix to inlude the whole DB or no point in some instances

Yeah, I had to just end up merging and now just rolling back. I’d love to test major changes but it’s tough going on for a few hours then finding the exact checkpoint to roll back to.

Hey Replit friends, looks like something is in the works for this still! https://x.com/kodylow/status/1956743961047175186 hat tip to @kody-replit and @victoria-replit !