diff --git a/nano/node/cli.cpp b/nano/node/cli.cpp index 3c6d6bfd8f..3d45d27882 100644 --- a/nano/node/cli.cpp +++ b/nano/node/cli.cpp @@ -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")) diff --git a/systest/migrate_to_rocksdb.sh b/systest/migrate_to_rocksdb.sh new file mode 100755 index 0000000000..66fd8f04fc --- /dev/null +++ b/systest/migrate_to_rocksdb.sh @@ -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