Hive: Exporting/Importing the database

Created on 1 Nov 2019  路  3Comments  路  Source: hivedb/hive

Question
Is it possible to export the database from one device to another?

question

Most helpful comment

Hive stores it's data in normal files. You can get the path with yourbox.path.
For example, you could do the following:

var file = File(yourBox.path);
var bytes = await file.readAsBytes();

All 3 comments

You can just copy the box file to the other device.

How exactly do you do that?

ps. I'm new to hive and have been playing with it for the last two days so i might have missed this in the docs or maybe there is a tutorial? Thanks for making a great noSQL db :)

Hive stores it's data in normal files. You can get the path with yourbox.path.
For example, you could do the following:

var file = File(yourBox.path);
var bytes = await file.readAsBytes();
Was this page helpful?
0 / 5 - 0 ratings