ReplitDB copy to other repl

I have a Flask repl with a ReplitDB database full of keys and values all organized in a structure.

Is it possible to copy that DB over to a different repl of mine? Would I use the $REPLIT_DB_URL in shell to do this?

Someone help me out. Thanks. :slight_smile:

Here is some code that should help

from replit import db, DataBase

otherDB = DataBase("<other db url>")
for key, value in db:
    otherDB[key] = value

This might work, have not checked if the db object has proper inter.

This would access the original DB?

I think (not sure) this would be run on the original repl, with the other db url being the new repl’s db URL.

1 Like

That makes no sense. I just want to copy the structure of the old DB in the old Repl to the new Repl.

Wait, so you want to copy the structure, not the value? Could you explain this structure and link the old repl?