Can't import snapshot to dev
Hi, I've exported a snapshot from production and I'm trying to import it into my dev instance.
However when I try and do the import I'm getting the following error:
The steps I'm taking are as follows:
- Clear all dev tables manually
- Run a Snapshot Export on the (prod) dashboard
- Run
npx convex import —replace SNAPSHOT_NAME.zip
When running the import, I see the following:
Import change summary:
table | create | delete |
----------------------------------------------
table1Name | 166 | 0 of 0 |
table2Name | 1 | 0 of 0 |
....
i.e. all tables are showing that nothing is in there to conflict...
Any help with this would be much appreciated.6 Replies
Hi! This is a class of conflicts I'm hoping to eventually fix, but right now every table has an inherent "format" for its IDs and they all have to be different. You should be able to fix the error by deleting the table "documents" from the dev deployment ("Delete table" button in the dashboard; may require removing from schema temporarily). This should remove the conflict
Another possible fix would be creating an empty table "documents" in prod so it is included in the snapshot. Then the import would know that it's okay to overwrite this table in dev and change its ID format
@lee that worked thank you!
(I misread the error message as there being documents in the table that conflict, rather than there being a table called
documents
....!)Good point we should add quotes around table names in error messages
Glad it worked!
I think the issue is that empty tables are not included in the export data.
If I unpack the .zip, and look at
./_tables/documents.jsonl
I can see that the first table listed here is the one shown in the error message. I notice my empty table is not listed in this file, which is the one that it is conflicting with.
Would including empty tables in the export avoid this issue @lee?are you sure empty tables aren't included in the snapshot export? That would be a bug
Upon double checking I found an empty table that was included, so I don't think this is the bug actually.
There was a table missing in the export though (named "docMigrations"), that was the cause of the "..has IDs that conflict with existing table..." error it seems (it was an empty table).