github.com/klaytn/klaytn@v1.12.1/db_migration/db_migration_non-single.sh (about) 1 # This code calls db migration. 2 3 # To use the db migration, a klaytn client should not be running. 4 # You need to have access to the DB. 5 # To checkout migration status, `tail -f logs-body.out` 6 7 # BIN file 8 KLAYTN_BIN=~/klaytn/bin/ken 9 10 # Source DB 11 SRC_DB_TYPE=LevelDB # one of "LevelDB", "BadgerDB", "MemoryDB", "DynamoDBS3" 12 SRC_DB_DIR=~/klaytn/data 13 SRC_DB_SHARDS=4 # should be 2^x 14 15 # Destination DB 16 DST_DB_TYPE=LevelDB # one of "LevelDB", "BadgerDB", "MemoryDB", "DynamoDBS3" 17 DST_DB_DIR=~/klaytn/db_migration/dst # for only localDB ("LevelDB", "BadgerDB", "MemoryDB"). neglected config for "DynamoDBS3" 18 DST_DB_SHARDS=8 # should be 2^x 19 20 ## For only DynamoDBS3 21 DST_TABLENAME=db-migration # for remoteDB ("DynamoDBS3"). neglected config for localDB 22 DST_RCU=100 # neglected config for existing DB. 23 DST_WCU=4000 # recommended to use auto-scaling up to 4000 while db migration 24 25 # set this value if you are using DynamoDB 26 export AWS_ACCESS_KEY_ID= 27 export AWS_SECRET_ACCESS_KEY= 28 29 # call db migration 30 $KLAYTN_BIN db-migration start \ 31 --dbtype $SRC_DB_TYPE \ 32 --datadir $SRC_DB_DIR \ 33 --db.num-statetrie-shards $SRC_DB_SHARDS \ 34 --dst.dbtype $DST_DB_TYPE \ 35 --dst.datadir $DST_DB_DIR \ 36 --db.dst.num-statetrie-shards $DST_DB_SHARDS \ 37 &> dbmigration-logs.out &