#Can't import snapshot to dev

8 messages · Page 1 of 1 (latest)

grizzled sorrel
#

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:

Hit an error while importing:
New table myTableName has IDs that conflict with existing table documents

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.

boreal merlin
#

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

grizzled sorrel
#

@boreal merlin 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....!)

boreal merlin
#

Good point we should add quotes around table names in error messages

#

Glad it worked!

teal brook
#

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 @boreal merlin?

boreal merlin
#

are you sure empty tables aren't included in the snapshot export? That would be a bug