The post records how to update “bitcoin-core” from version “0.18” to version “0.21” on Ubuntu “20.04”.
# 1. Remove the existing version.
when doing this, you don’t need to do anything on your data directory. After executing the commands above, open “bitcoin-core”, you will be prompted to set your data directory. At this point, you can set your existing data directory there. Note that, if you want to keep the full blockchain data, UNCHECK the option of “Prune old blockchain data” in the guidance dialog box. If the option is checked, the old blockchain data will be pruned and only the latest 2GB blockchain data will be kept. This will definitely save you a lot of disk space, but it also means you lose the blockchain data integrity.