diff --git a/src/storage/import/legacy/mod.rs b/src/storage/import/legacy/mod.rs index cbc62d9de..ce891e1ec 100644 --- a/src/storage/import/legacy/mod.rs +++ b/src/storage/import/legacy/mod.rs @@ -12,7 +12,6 @@ pub fn init_database() -> Result { let connection = Connection::open_with_flags( &db_path, rusqlite::OpenFlags::SQLITE_OPEN_READ_WRITE - | rusqlite::OpenFlags::SQLITE_OPEN_CREATE | rusqlite::OpenFlags::SQLITE_OPEN_NO_MUTEX | rusqlite::OpenFlags::SQLITE_OPEN_NOFOLLOW, )?; diff --git a/src/storage/import/mod.rs b/src/storage/import/mod.rs index 62af17ae8..956773a94 100644 --- a/src/storage/import/mod.rs +++ b/src/storage/import/mod.rs @@ -12,7 +12,17 @@ impl Storage { let mut txn = self.env.write_txn()?; // Progress the legacy database to the endpoint first - let mut db = legacy::init_database()?; + let mut db = match legacy::init_database() { + Ok(db) => db, + Err(_) => { + // Probably missing. Let's mock up default necessary data: + let settings: Settings1 = Default::default(); + self.write_settings1(&settings, Some(&mut txn))?; + txn.commit()?; + self.sync()?; + return Ok(()); + } + }; legacy::setup_database(&mut db)?; tracing::info!("LDMB: setup");