Skip to content

importDB and importInto #2063

Closed Answered by dfahlander
laukaichung asked this question in Q&A
Discussion options

You must be logged in to vote

There is no upgrading support built into dexie-export-import. It's just that if you use importDB it will create a database with the same version as it was when it was exported. Opening it again using a declared Dexie instance with a higher version and upgraders declared, these upgraders will run into the data.

In your case, you have already existing data and you want to keep it and just merge the import into the existing database. In this case you might have to implement migration your custom way for the imported data.

  1. use peakImportFile() to find out which data version the import file is on.

    const { formatName, formatVersion, data }  = await peakImportFile(blob);
    if (formatName !== "de…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dfahlander
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants