Open dayfuaim opened 5 years ago
@dayfuaim Sorry it has gotten me so long to get back to you on this. Could you try it again? We've made some improvements to the import process.
The way I recommend doing it is by creating a profile, and then going into settings and clicking on "Recover from backup" in the backup tab. That should ask you for your previous password, and then it will migrate them. The migration process doesn't always refresh the window when it's done (that's something I'm working on) but if you wait until after the bar has progressed and then refresh your screen, they should be there. I've tested it a couple times with different laverna backups and it seems to work consistently so far.
@daed I tried to do this. I've turned DevTools ON. So...
I did the above several times creating new profiles – the same result.
From Console output I can consider that Encryptic during migration tries to encrypt notes but fails (my notes are unencrypted) and continues.
Console output (the error part):
...
Encryption.js:315 encryption: getUserKeys()
Encryption.js:324 encryption: getUserKeys(): returning keys
Encryption.js:407 encryption: encryptModel()
Encryption.js:344 encryption: encrypt(): starting data:
Encryption.js:345 {"name":"w6610"}
Encryption.js:315 encryption: getUserKeys()
Encryption.js:324 encryption: getUserKeys(): returning keys
Encryption.js:407 encryption: encryptModel()
Encryption.js:344 encryption: encrypt(): starting data:
Encryption.js:345 {"name":"project"}
Encryption.js:315 encryption: getUserKeys()
Encryption.js:324 encryption: getUserKeys(): returning keys
Encryption.js:407 encryption: encryptModel()
Encryption.js:344 encryption: encrypt(): starting data:
Encryption.js:345 {"name":"mac"}
Encryption.js:315 encryption: getUserKeys()
Encryption.js:324 encryption: getUserKeys(): returning keys
Encryption.js:407 encryption: encryptModel()
Encryption.js:344 encryption: encrypt(): starting data:
Encryption.js:345 {"name":"knhd"}
Encryption.js:315 encryption: getUserKeys()
Encryption.js:324 encryption: getUserKeys(): returning keys
browser.js:183 lav:components/importExport/migrate/Controller error +42s TypeError: Cannot read property 'sync' of undefined
at Tags.remove (Module.js:343)
at Tags.saveModel (Tags.js:91)
browser.js:183 lav:workers/Delegator delegating method 'save' to workers +842ms
browser.js:183 lav:workers/Delegator sending data: +1ms {action: "execute", promiseId: 107, data: {…}}
...
Whole number is 145 notes.
Update: The above is correct also for desktop app.
I was caught by surprise when laverna.cc disappeared... I have a backup from January, and tried migrating here. I got the fail to migrate error, and all it got was the titles of the notes.
I tried migrating again, this time watching the console, and this is what I got:
loading file:
Import.js:285 ArrayBuffer(168767) {}
Import.js:302 JSZip {files: {…}, comment: null, root: "", clone: ƒ}
Import.js:303 File {name: "laverna-backup (4).zip", lastModified: 1546547714652, lastModifiedDate: Thu Jan 03 2019 14:35:14 GMT-0600 (Central Standard Time), webkitRelativePath: "", size: 168767, …}
Import.js:304 files:
Import.js:307 import: import(): Old laverna backups detected.
Import.js:359 import: importCollections(): isOldBackup is true
101Import.js:364 importCollections(): ignoring [object Object]
I have similar problem with loading backup ZIP from Laverna:
lav:components/importExport/migrate/Controller error +24s TypeError: Cannot read property 'sync' of undefined
at Tags.remove (Module.js:343)
at Tags.saveModel (Tags.js:91)
at async Tags.saveModelObject (Module.js:303)
After refresh the app shows all the notes in the sidebar but each with empty content.
When I open Chrome Dev Tools -> Application -> Storage -> IndexedDB -> lav-... -> notes
all the notes have ± the same length of encryptedData
although with different content. I certainly have more data in the note than the length of encryptedData
.
Laverna appVersion: 0.5.0 Encryptic appVersion: 1.0.0
@petrkrejcik Where did you get that appVersion from?
I'm looking at this now. I don't have any root cause identified yet.
@daed
I noticed a different behaviour whether the Laverna backup was encrypted or not.
In case it wasn't encrypted, the note content is stored in the .md files instead of the .json and it's not imported to the notes-db database.
I had a fix in my own fork, I need to test it again and I'll bring it to a pull request https://github.com/jfsigrist/encryptic/commit/4feb3ac0134ecf326e3f0fbb248f1e8709da6677
@daed The Laverna appVersion
is in the backup ZIP file -> notes-db -> configs.json
@jfsigrist All my backup notes are unencrypted. If it helps I can provide the backup ZIP file (containing just some public notes only).
Temporary workaround: Encrypt the notes in Laverna and import encrypted backup.
We put in some more changes for the laverna import and I've cut a new release and updated the web-app. I think that the problem was specifically related to unencrypted notes. Can you try the note import again?
@daed Yes, I succeeded at last to import to web-app. :) Although thru "Migration failed" window, but import was successful (unencrypted version of backup).
Next step is standalone build. :)
UPDATE: Standalone build also has succeeded to import. But only laverna-ENCRYPTED this time.
Unfortunately, I couldn't describe every single step to get this result. :( But latest steps were:
I think this is in much better shape now. There was an issue in the way models were being handled during the encryption/import stage that was potentially impacting anything being imported.
Can you give it a shot in the new release? It should also be on https://app.encryptic.org.
@daed I have tried to import from Laverna old encrypted backup – success. As for me, I have no questions about it. :)
If others don't have questions too – I think we should close this issue at last. :)
When importing from
laverna-backup.zip
, web-app is still not importing notes. It imports my notebooks and tags. But they are empty.Creating notes within web-app is OK.