I'm using Geth version 1.8.17-stable on ubuntu server and syncing with "fast" mode. I want to upgrade Geth to v1.8.23 to sync blocks generated after the hard fork. But I couldn't find how to upgrade it like my question. I'm not sure that I have to stop running Geth or not. And if I have to stop Geth and update it, then how could I do it without removing synced data? I thought if I stop Geth, and run it again, I would have to delete the data because it crashes with the giving sort of message "Your database is not clean". (I'm not sure with the log message but it was like this by my memory.)
I was little bit worried about re-syncing all the stuff again, but it was just a concern. I figured it out now. I'll share it how I did it. I used ubuntu server, so I'll talk about this.
Step 1. Stop the Geth which was running.
kill -9 <geth pid>
Step 2. Upgrade Geth version.
sudo apt-get install software-properties-common sudo add-apt-repository -y ppa:ethereum/ethereum sudo apt-get update sudo apt-get upgrade
Step 3. Run Geth fast mode at background.
It was simple. At first, the log will show this kind of message.
INFO [03-05|04:54:51.890] Upgrading chain index type=bloombits percentage=25
With this log, the server keeps syncing with ethereum network. After the percentage gets to 100, when typing eth.syncing at geth console, the highestBlock number would change to near the latest.