# Updating Central from V1.2 to 2023.3 on DigitalOcean ## Prepare for update ###Create a snapshoot of the ODK central droplet - this can take about 30 mins Create a snapshot using the DigitalOCean web interface Open up the ODK central console ## In the console cd central docker compose stop git status ##NOTE if there are things that need removing first check what would be removed and if ok remove ### Print out the list of files and directories which will be removed (dry run) git clean -n -d ### Delete the files from the repository git clean -f ### Retry stashing - also worth double checking you're .env at this stage nano .env ### Stash changes that have been made and then use git stash #NOTE Use git stash pop later on the bring back any chenges you've made ## Check Docker Version and Update docker --version && docker compose version docker-compose --version for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done sudo apt autoremove sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg echo \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo docker run hello-world ## Remove the old version rm -f `which docker-compose` # Get the new version of postgres and Central git status grep DB_HOST .env ##NOTE I'm not using a custom DB so just continue with the ODK central Update to 2023.2 instructions git pull git submodule update -i # Upgrade Postgres sudo ./files/postgres14/upgrade/check-available-space touch ./files/allow-postgres14-upgrade git stash pop docker compose stop docker compose pull docker compose build --pull docker compose up postgres ls ./files/postgres14/upgrade/upgrade-successful docker compose up -d docker image prune docker compose up postgres touch ./files/postgres14/upgrade/delete-old-data \ && docker compose up --abort-on-container-exit postgres ## Check the health docker compose ps # Update the .env file ##NOTE my .env file is the old version so here i'm getting the new version and updating with my DOMAIN and email docker compose stop ## Check the .env file nano .env ## Get the latest version cp .env.template .env ## Edit the .env to add the domain and email nano .env # If the nginx is restrating ##NOTE At this stage my nginx only restrats not starts so I then remove it and rebuild docker compose rm nginx -v docker compose build docker compose up -d # Check the health docker compose ps # If the URl isn't working make sure both nameservers are directing to the correct IP address #If still not working check update is completed - wait for checking migration success to be printed in the console docker compose logs service --tail 50 # If the URl isn't working make sure both nameservers are directing to the correct IP address #If still not working check update is completed docker compose logs service --tail 50 # IF you get 'Error Could not connect with Form Server - https://docs.getodk.org/central-troubleshooting/ - Preview could not connect with server' cat /run/systemd/resolve/resolv.conf nano /etc/docker/daemon.json namesserver xx.xxx.xx.x namesserver xx.xxx.xx.x