How to upgrade Central from v1.5.3 to latest?

1. What is the issue? Please be detailed.
I want to upgrade my ODK Central from v1.5.3 to the latest stable one.
Below is my Amazon EC2 docker specifications
docker version
Output
Version 20.10.20
API 1.41
Go Version go1.18.7
OS linux/amd64
instance type m5.xlarge

2. What steps can we take to reproduce this issue?
I am seeing many links
like

  1. https://docs.getodk.org/central-upgrade/#central-upgrade-2023-4
  2. https://docs.getodk.org/central-upgrade/#central-upgrade-1-5
    3.Upgrade instructions for Central v1.5.3

3. What have you tried to fix the issue?
Not, looking for correct and clear instructions.

4. Upload any forms or screenshots you can share publicly below.
Not applicable.

I am in the process of upgrading my server after a significant period, and I have noticed numerous links in the forum. If anyone could share valuable information or resources, it would be greatly appreciated and helpful for me.

Thank you in advance for your assistance.

This is my error

*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
Error: getaddrinfo ENOTFOUND postgres
checking migration success..
Error: getaddrinfo ENOTFOUND postgres
*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
Error: getaddrinfo ENOTFOUND postgres
checking migration success..
Error: getaddrinfo ENOTFOUND postgres
*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
Error: getaddrinfo ENOTFOUND postgres
checking migration success..
Error: getaddrinfo ENOTFOUND postgres
*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
Error: getaddrinfo ENOTFOUND postgres
checking migration success..
Error: getaddrinfo ENOTFOUND postgres
*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
Error: getaddrinfo ENOTFOUND postgres
checking migration success..
Error: getaddrinfo ENOTFOUND postgres
*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
Error: getaddrinfo ENOTFOUND postgres
checking migration success..
Error: getaddrinfo ENOTFOUND postgres
*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
Error: getaddrinfo ENOTFOUND postgres
checking migration success..
Error: getaddrinfo ENOTFOUND postgres
*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
Error: getaddrinfo ENOTFOUND postgres
checking migration success..
Error: getaddrinfo ENOTFOUND postgres
*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
Error: getaddrinfo ENOTFOUND postgres
checking migration success..
Error: getaddrinfo ENOTFOUND postgres
*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
Error: getaddrinfo ENOTFOUND postgres
checking migration success..
Error: getaddrinfo ENOTFOUND postgres
*** Error starting ODK! ***
After attempting to automatically migrate the database, we have detected unapplied migrations, which suggests a problem with the database migration step. Please look in the console above this message for any errors and post what you find in the forum: https://forum.getodk.org/```

https://docs.getodk.org/central-upgrade are the official instructions.

Start by reviewing upgrade notes for all versions between your current version and the one you are upgrading to. You can skip upgrades and directly install the latest version as long as you make sure to follow all relevant upgrade instructions.

If you are stuck, it would be good to know exactly what you did to upgrade.

I am using Central 1.5.3. Here is my container id and their names
ODK_Central_container_18March

After seeing it deeply, I found out that in ODK Central v1.5.3 naming system was "central_service, central_enketo" However in V2023.3 all containers have names like "central-service, central-enkento, central-ngnix". So, while updating the server, from v1.5.3 to 2023.3. How ODK will change these container names? If not then how can we change these names?

I followed these instruction, and I did not find any command or method to rename these containers. If I can not rename than I think my ODK server will be into infinit restart mode. Please correct me if I am wrong. Or if I need to rename ODK container names before upgrading it?

Best,
@iamnarendrasingh

Is there anyone @Insiders who can help me with the ODK Central update on Amazon EC2.
Below is my worry.
I found out that in ODK Central v1.5.3 naming system was "central_service, central_enketo" However in V2023.3 all containers have names like "central-service, central-enkento, central-ngnix". So, while updating the server, from v1.5.3 to 2023.3. How ODK will change these container names? If not then how can we change these names?

Can any one advise me how to do these with containers?

Best,
@iamnarendrasingh

If you are starting with Central v1.5.3, then you want to carefully read and follow all the steps for each of the newer versions. That is follow any special instructions at Upgrading to Central v2022.3 and then scroll up the page and follow any special instructions for the rest:

  • Upgrading to Central v2023.1
  • Upgrading to Central v2023.2
  • Upgrading to Central v2023.3
  • Upgrading to Central v2023.4

I would take note of all the commands you run, in order, so that you can provide those details if troubleshooting.

You do not need to worry about the container names unless you have done some custom configuration or integration that uses those names. The upgrade process, following the instructions, will make all necessary changes.

1 Like

Thanks for your instructions, when I am running command
sudo ./files/postgres14/upgrade/check-available-space
at steps

I am getting outout which is this

I think i have to install postgres14 seperatly ,am I correct?
Looking forward for support.

When I visited file system , I have this command here is scrrenshot.

I tried command "chmod +x ./files/postgres14/upgrade/check-available-space' but stillsameissues is there.

Best,
@iamnarendrasingh

I resolved above issues with command

sudo chmod +x ./files/postgres14/upgrade/check-available-space

Now ,when I am running command

git stash pop

I got error which is

For inspecting this I run command

cat files/service/config.json.template

and I got output which is like

{
  "default": {
    "database": {
      "host": "${DB_HOST}",
      "user": "${DB_USER}",
      "password": "${DB_PASSWORD}",
      "database": "${DB_NAME}",
      "ssl": ${DB_SSL}
    },
    "email": {
      "serviceAccount": "${EMAIL_FROM}",
      "transport": "smtp",
      "transportOpts": {
<<<<<<< Updated upstream
        "host": "${EMAIL_HOST}",
        "port": ${EMAIL_PORT},
        "secure": ${EMAIL_SECURE},
        "ignoreTLS": ${EMAIL_IGNORE_TLS},
        "auth": {
          "user": "${EMAIL_USER}",
          "pass": "${EMAIL_PASSWORD}"
        }
      }
=======
        "host": "mail",
        "port": 25
       }
>>>>>>> Stashed changes
    },
    "xlsform": {
      "host": "pyxform",
      "port": 80
    },
    "enketo": {
      "url": "http://enketo:8005/-",
      "apiKey": "${ENKETO_API_KEY}"
    },
    "env": {
      "domain": "${BASE_URL}",
      "sysadminAccount": "${SYSADMIN_EMAIL}"
    },
    "oidc": {
      "enabled": ${OIDC_ENABLED},
      "issuerUrl": "${OIDC_ISSUER_URL}",
      "clientId": "${OIDC_CLIENT_ID}",
      "clientSecret": "${OIDC_CLIENT_SECRET}"
    },
    "external": {
      "sentry": {
        "orgSubdomain": "${SENTRY_ORG_SUBDOMAIN}",
        "key": "${SENTRY_KEY}",
        "project": "${SENTRY_PROJECT}"
      }
    }
  }
}

Above is output, please have a look and let me know how can i fix this?

I have updated my ".env" file as well. Here is output of "cat .env"

ubuntu@ip-172-31-21-218:~/central$ cat .env

# Use fully qualified domain names. Set to DOMAIN=local if SSL_TYPE=selfsign.
DOMAIN=selfdomain.com

# Used for Let's Encrypt expiration emails and Enketo technical support emails
SYSADMIN_EMAIL=email@email.com

# Options: letsencrypt, customssl, upstream, selfsign
SSL_TYPE=letsencrypt

# Do not change if using SSL_TYPE=letsencrypt
HTTP_PORT=80
HTTPS_PORT=443

EMAIL_FROM=email@email.com
EMAIL_HOST=email-smtp.ap-south-1.amazonaws.com
EMAIL_PORT=587
EMAIL_IGNORE_TLS=false
EMAIL_SECURE=false
EMAIL_USER=##########
EMAIL_PASSWORD=##########

# Optional: configure Node
SERVICE_NODE_OPTIONS=--max_old_space_size=8000

Is there anyone who can help me with this? Anyone from can guide me or give me a reference for this?

Best,
@iamnarendrasingh

I restart upgrading process and while I am running command

sudo ./files/postgres14/upgrade/check-available-space

System is giving me an error which is

Error: No such object: central-postgres-1

But I have that into my system.

You are getting that error because Central was run with an old version of Docker compose and the disk space script doesn't know that. I'll send in a fix for the next release of Central.

Try running nano /files/postgres14/upgrade/check-available-space and make this change from L20:24.

Old code

if ! docker compose version >/dev/null 2>/dev/null; then
  containerName="central_postgres_1"
else
  containerName="central-postgres-1"
fi

New code

if docker ps -a --format '{{.Names}}' | grep -q "central_postgres_1"; then
    containerName="central_postgres_1"
else
    containerName="central-postgres-1"
fi

After saving the edit, re-run the check-available-disk and see if that works better.

1 Like

I fixed this issue with command

sudo chmod +x ./files/postgres14/upgrade/check-available-space

Thanks for your support.

Best,
@iamnarendrasingh

2 Likes