Export database for sneakernet
It would be nice if there was a way to export the user's profile to a backup file, optionally including replicated content. That way, if a user was only connected to rooms or was otherwise not connected to someone else who replicated them, they'd have a way to preserve their data if the browser's local storage was cleared.
To do this, we would need to also be able to support importing from whatever format we output in.
And as an additional bonus, if we could import exports from other folks, then ssb-browser-demo could theoretically be used offline while exchanging feed data over USB flash drives.
Would need some help figuring out how to do this, but I think this could be a really great feature for data durability and overall robustness.
There is already a export feed key to mnemonic code under /profile that should cover this. Maybe the name is a bit to cryptic ;)
Perhaps I should clarify. I've used the mnemonic key stuff several times with testing. But what happens if you only connect to rooms (not pubs) and the people you would normally connect to (who would have copies of the data you need to be able to use a mnemonic code without forking your identity) are not online? Or if you're on a terrible internet connection and want to preseed your database with already previously-downloaded data? I could see recovering an account going something like this:
- Import prior exported data.
- Import mnemonic key to recover the private key and continue using your normal identity.
And you now have data without connecting to anyone.
Ah right, now I see.
Updated the name of this issue to make it clearer what I meant.
Pretty sure we can do the export in a memory-efficient way using this:
https://github.com/jimmywarting/StreamSaver.js
@arj03 Didn't realize that you had already done something similar to this in another project:
https://github.com/arj03/ssb-exporter
Just saw it mentioned on SSB. That would make this quite easy to do within ssb-browser-demo.
Yeah, that is a few years ago, I guess it's mainly a question then of bundling it into a zip or something like that :)