Ghost shouldn’t be storing the configured URL anywhere in the database, instead it should be stored as __GHOST_URL__ and transformed dynamically. That allows you to change the url value in your config file and have everything just work without needing to mess with any manual replacement steps.