Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nano/node/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,13 @@ std::error_code nano::handle_node_options (boost::program_options::variables_map
if (error)
{
std::cerr << "There was an error migrating" << std::endl;
std::exit (1);
}
}
catch (std::exception const & e)
{
std::cerr << "Error initializing node for migration: " << e.what () << std::endl;
std::exit (1);
}
}
else if (vm.count ("rollback"))
Expand Down
23 changes: 23 additions & 0 deletions systest/migrate_to_rocksdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -eux

# Test database migration from LMDB to RocksDB

DATADIR=$(mktemp -d)

# Force lmdb backend
NANO_BACKEND=lmdb $NANO_NODE_EXE --initialize --data_path $DATADIR --network test

if [ ! -f "$DATADIR/data.ldb" ]; then
echo "ERROR: LMDB data.ldb file not found"
exit 1
fi

$NANO_NODE_EXE --data_path $DATADIR --network test --migrate_database_lmdb_to_rocksdb

if [ ! -d "$DATADIR/rocksdb" ]; then
echo "ERROR: RocksDB directory not found"
exit 1
fi

exit 0
Loading