#Support for `convex import` from a snapshot export?

10 messages · Page 1 of 1 (latest)

teal sandal
#

When I try to use convex import to restore a table snapshot I just downloaded, I get this error:

500 Internal Server Error: InternalServerError: Your request couldn't be completed. Try again later.

Adding --append doesn't help. I'm using Convex 0.12.2

latent moss
#

Hi! Sorry about the error, we see it on our side and will fix it soon. The issue is your data includes _id and _creationTime fields which cannot be imported. As a workaround, you could process the data (with python or node) to remove those fields.

teal sandal
#

Oof but that makes sense. Is there a different way to backup and restore data from the DB?

whole ginkgo
#

There isn't a turnkey backup and restore at the moment. A backups feature has been discussed but not started. We're working on some improvements that will make it possible to do correctly, though.

#

There is one thing I've been toying with the idea of, which I'd be interested in your feedback on:

A script that turns a snapshot export (dir of JSON files) into a seed script, so you can take a deployment's data and make code to bootstrap a new dev deployment, in CI, etc.

#

It would do inserts in batches, and may need to write documents with old ID references and patch them later with the new IDs, so this would mean the data would be inconsistent until the seeding is done. This is fine for a new dev deployment, but is risky for a prod deployment where you'd want transactional guarantees. (which is ultimately why we don't offer the snapshot import by default)

I'd publish this code in a repo for folks to use / vendor in. Then you can adjust it if you want different behavior

#

Support for convex import from a snapshot export?

dreamy pasture
#

@whole ginkgo is is possible to export a snapshot from dev and import it into prod?

latent moss
#

@dreamy pasture that is possible now, yes (this is a very old thread)