Upgrading an older instance post Ubuntu 22.04 upgrade

Hi!

I am trying to upgrade an older instance post a Ubuntu 22.04 upgrade and encountering a few issues I was hoping someone could please help me with. Specifically I am struggling with updates:
73. Prepare project spaces for Case List Explorer report release
75. Reindex All Indices For Elasticsearch Upgrade

When attempting 73, I get the following error:

(python_env-3.9) (monolith) cchq@monolith:~/www/monolith/current$ python manage.py prepare_projects_for_case_list_explorer
Unknown command: 'prepare_projects_for_case_list_explorer'
Type 'manage.py help' for usage.
  1. Succeeded with no problems.

When attempting 75, I get the following error:

(cchq) myuser@monolith:~/commcare-cloud$ cchq monolith django-manage elastic_sync_multiplexed estimated_size_for_reindex
ssh myuser@172.31.26.146 -t -o UserKnownHostsFile=/home/myuser/environments/monolith/known_hosts 'sudo -iu cchq bash -c '"'"'cd /home/cchq/www/monolith/current; python_env/bin/python manage.py elastic_sync_multiplexed estimated_size_for_reindex'"'"''
Ubuntu 22.04.2 LTS
usage: manage.py elastic_sync_multiplexed [-h] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback]
                                          [--no-color] [--force-color] [--skip-checks]
                                          {start,status,cancel} ...
manage.py elastic_sync_multiplexed: error: argument sub_command: invalid choice: 'estimated_size_for_reindex' (choose from 'start', 'status', 'cancel')
Connection to 172.31.26.146 closed.

My understanding is that one can continue with 75 by building the indexes one-by-one, but when I attempt to follow the instructions, at Step 5.2, I get the following error:

(monolith) cchq@monolith:~$ sudo -iu cchq
(monolith) cchq@monolith:~$ cd /home/cchq/www/monolith/current
(monolith) cchq@monolith:~/www/monolith/current$ source python_env/bin/activate
(python_env-3.9) (monolith) cchq@monolith:~/www/monolith/current$ export INDEX_CNAME='apps'
(python_env-3.9) (monolith) cchq@monolith:~/www/monolith/current$ ./manage.py elastic_sync_multiplexed start ${INDEX_CNAME}
Traceback (most recent call last):
  File "/home/cchq/www/monolith/releases/2023-06-12_14.00/./manage.py", line 189, in <module>
    main()
  File "/home/cchq/www/monolith/releases/2023-06-12_14.00/./manage.py", line 47, in main
    execute_from_command_line(sys.argv)
  File "/home/cchq/www/monolith/releases/2023-06-12_14.00/python_env/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/home/cchq/www/monolith/releases/2023-06-12_14.00/python_env/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/cchq/www/monolith/releases/2023-06-12_14.00/python_env/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/cchq/www/monolith/releases/2023-06-12_14.00/python_env/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/home/cchq/www/monolith/releases/2023-06-12_14.00/corehq/apps/es/management/commands/elastic_sync_multiplexed.py", line 142, in handle
    cmd_func(options['index_cname'])
  File "/home/cchq/www/monolith/releases/2023-06-12_14.00/corehq/apps/es/management/commands/elastic_sync_multiplexed.py", line 32, in start_reindex
    raise IndexNotMultiplexedException("""Index not multiplexed!
corehq.apps.es.exceptions.IndexNotMultiplexedException: Index not multiplexed!
            Sync can only be run on multiplexed indices

So it looks to me like I am doing something wrong... Any suggestions would be greatly appreciated!

Thanks,

Dirk

Hi, @dirkdejager .

Regarding 73: That's indeed strange. My immediate question would be whether you are on the latest code? You can check if the management command exists here: corehq/apps/reports/management/commands/prepare_projects_for_case_list_explorer.py

If not, you're probably not using the latest code and that's probably why it's not recognizing a lot of the commands.

Hi @dirkdejager

Would be good to run the updates only in sequence. Omitting an update might have unexpected results.

I see you are catching up on updates from 2023 and our recommended follow up is every 2 weeks, Expectations for Ongoing Maintenance — CommCareHQ Deployment documentation.
Have you already updated the code to the latest code?

Is this is a live environment or local setup?
If it is an active environment,
I would recommend taking a data backup and noting down the commcare commit the code is currently working environment is at.