Upgrade central to not-most-recent version

Hi,

How to upgrade central to v2023.1 or earlier, instead of the latest version v2023.2? Which commands to use?

Regards,
Saad

I think you should be able to modify the pull command during the upgrade as follows:

git pull origin <commit_hash>

You should be able to get the commit_hash from the list of releases
so for v2023.1.0 it should be 00364ca4767abad989bed50ff408291d246bd5df

I am not sure if the next step (running git submodule update -i) will update according to the central code version, or if it will automatically pull the latest.

Many thanks. I would love to get some more opinion about if all other commands would run OK or not (just trying to avoid getting stuck in the middle of neither-here-nor-there).

Running the not-most-recent version is almost always a bad idea. What high-level problem are you trying to solve by not running the most recent version?

1 Like

Well, the upgrade instructions for v2023.2 (the current recent) demand a very careful and tedious procedure for upgrade since its an infrastructure-intensive process. With couple of my big production projects, I would prefer not to take the risk (only for now) for any upgrade failing for any reason, because of nature of the project. But at the same time, really want to upgrade them from v1.5 to at least v2023.1, so that at least some compatibility remains for future upgrade. I'll see if I could upgrade them to latest some months later.

That sounds like a good approach. Just remember to read all the upgrade notes between your current version and the one you'll be upgrading to.

The only thing that needs to change is that you checkout a version after the clone.

git clone https://github.com/getodk/central
git checkout v2023.1.0
git submodule update -i
...

The rest of the commands should work, but when you need to upgrade in the future, you'll need to remember to git checkout master first and deal with whatever merge conflicts exists.

2 Likes

Hi Yaw,

I am about the upgrade an old version of Central v1.4.2 to v2023.1. Isn't the first command you mentioned going to download a full copy of central? The upgrade notes I see are starting from 'git pull' and not 'git clone https://github.com/getodk/central'. Since the server already has an installed copy, I don't want to override it.

Looking for help before moving ahead...

I would love to get some more opinion about if all other commands would run OK or not (just trying to avoid getting stuck in the middle of neither-here-nor-there).

I would prefer not to take the risk (only for now) for any upgrade failing for any reason, because of nature of the project..

.

Yes, correct, git pull and then git checkout v2023.1.0 should get you what you want.

Can you please give us more context on what you're trying to do? If you're trying to update to a specific version, the above should be what you're looking for.

1 Like

Thanks @LN.

So would this be the right set of commands?

//Assuming central is already installed
$ cd central
$ git pull
$ git checkout v2023.1.0
$ git submodule update -i
$ docker-compose build
$ docker image prune
$ docker-compose stop
$ docker-compose up -d
$ docker-compose ps

PS. Sorry for requesting a desperate, step-by-step handholding here.

That looks right to me. There might be issues trying to build versions before v1.5.3 but I believe v2023.1.0 should be fine. As always, we strongly recommend taking a full-machine snapshot if you can or at least a db backup.

If you have any doubts, you can restore the full-machine snapshot to another server and try the upgrade there. That will give you a good sense of how long the upgrade takes and any possible issues you might run into.

There are some long migrations going into v2023.1.0 so make sure you do have a maintenance window available no matter what.

1 Like

You don't need the stop. I'd prune after the ps.

$ cd central
$ git pull
$ git checkout v2023.1.0
$ git submodule update -i
$ docker-compose build
$ docker-compose up -d
$ docker-compose ps
$ docker image prune
1 Like

There might be issues trying to build versions before v1.5.3 but I believe v2023.1.0 should be fine.

So for central versions 1.3 and 1.4, I assume I can do an upgrade to 1.5.x first through the same method mentioned above, and then from 1.5.x I can jump to 2023.1.

There are some long migrations going into v2023.1.0 so make sure you do have a maintenance window available no matter what.

For me, it doesn't take more than 5 minutes for the upgrade process to complete. Never took more time, even in upgrades to 2023.1 on other servers. It has mostly been very smooth going, without any hassles.

You should go straight to 2023.1. I mean that sometimes prior versions can't build at all. We know that's the case with 1.5.2 and prior.

Good to know! That kind of feedback his helpful. We do administer some very big servers so we can sometimes get an unrealistic sense of the upgrade experience.

A post was merged into an existing topic: Upgrade from 1.5.2 to latest failed