I want to upgrade ERPNext version 13.2.0 to 13.25


I have the docker version of ERPNext ver: 13.2 installed in a ubuntu 20.04 VM in VirtualBox. MariaDB version is 10.3. This is a production environment. I would like to upgrade it to 13.25.

Can someone please explain what’s the best way to upgrade it to 13.25 safely without loosing any data? Will it also upgrade the Maria DB DB version? If not, is it a good idea to upgrade the DB too? If so, how?

My 2nd question is docker version of ErpNext good for production?

Thanks for your time in advance.

can you share the docker-compose used to setup the v13.2.0

It was originally installed through a vagrant script and this is what I have in the script:

config.vm.provision “shell”, inline: <<-SHELL
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common docker-compose -y
cd /root/
git clone GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext
echo “LETSENCRYPT_EMAIL=email@example.com

SKIP_NGINX_TEMPLATE_GENERATION=0” > /root/frappe_docker/.env
cd /root/frappe_docker/
docker-compose up -d

I tried changing the version here in the script but that didn’t do any good. After upgrade When I tried to log in, I saw INTERNAL SERVER ERROR.

Hello @revant_one, any recommendation?

backup your files.

create fresh new installation.

restore backup.

I’ve never used any scripts to install ERPNext with containers

You mean run a site backup like this on the existing v13.2 and restore it on v13.25?

frappe@27c5ce9a650d:~/frappe-bench/sites$ bench --site example.com backup

frappe@97b2d7c1e09f:~/frappe-bench/sites$ bench --site example.com restore ./example.com/private/backups/20220414_085911-example_com-database.sql.gz

If yes, I already have tried without success. I believe I got an Internal Server Error when I tried to access erpnext after restoring.
I thought it could be due to the mismatch version of both Erpnext (13.2 vs 13.25) and Maria DB (10.3 vs 10.6)

What’s the correct way of upgrading from a lower version to higher?

how did you install latest, there was a refactor, the script you used won’t work now after the refactor.

I cannot debug your VM. I won’t be able to help much.

I helped this post as access to the server was shared with me

@revant_one, Thank you for the clarifications, I really appreciate it. It appears now that the way I was upgrading from 13.2 to 13.26 was wrong. I was simply taking docker containers down and changing the version in the .env environment variable file from 13.2 to 13.26 which wasn’t doing much as you confirmed that it wouldn’t work with the new version.

These are the steps I followed to install the new version:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common docker-compose -y
cd /root/
git clone GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext
cd /root/frappe_docker/
docker-compose up -d

I immediately saw the env-production file that used to be readily available is no longer available for the production and I see an example.env file in there. I also see the docker-compose.yml file is gone from the /frappe_docker/ directory and there are two new files compose.yml and pwd.yml.

I’m not sure of my installation is complete as I cannot run the docker-cmpose up without the docker-compose.yml file, right?

Is there a wiki page of how to install ErpNext 13.26 docker version in production that I could refer?

All I need is to have the latest version ErpNext installed and my data being restored on the new version.

Thanks @revant_one. I was able to install the latest version successfully. Thank you so much for the instructions.
Can you please tell me what command I would have to use to stop the services. In the older version I used

docker-compose down


docker-compose up -d

to run it.
Secondly will the site backup still work as I explained earlier? (Please note the backup would be from ErpNext 13.2 and the same has to be restored on 13.27.)
OR how can I restore my files and database from the old version to new version?

Doesn’t bench update work for you?

I successfully upgraded V13.11 to V13.26. My installation method was manual and not docker though.

check all projects with

docker compose ls

to stop/start try,

docker compose -p project-name stop

docker compose -p project-name start

do migrate after restore.

bench --site site.name migrate

bench update is not framework command, it’s not available inside container, migrate is framework command, it is available.

1 Like

This is what I get when I run the command to stop:

root@erp:~/frappe_docker# docker compose -p project-name stop
invalid interpolation format for x-backend-defaults.image: “required variable FRAPPE_VERSION is missing a value: No Frappe version set”. You may need to escape any $ with another $.

Did I miss a step or something to update the frappe version? I see it in the ~/gitops/erpnext-one.env file

and I don’t see a version in the compose.yml file

but not sure if the version has to be updated there or somewhere else?

try adding --env-file path/to/env to the command

I think I misunderstood the command you wanted me to run in your second last response. I was using the command wrong. I was trying to stop everything together in the old fashion and instead of using the actual project name I was typing “–project-name”, literally.
I tried this and it worked:

However when I tried to stop the other two services they didn’t stop.

try running the commands from some other directory?
I think it picks up compose.yml from the directory even if you do docker compose -p traefik ...

Still the same: :frowning:

may be you can directly stop the containers?

docker stop traefik-traefik-1 mariadb-database

i guess the erpnext-one redis didn’t stop because it picked up compose from root which doesn’t have redis.

You were right. erpnext-one redis didn’t stop. There is no “compose.yml” in /root/. It’s in /root/frappe_docker from where I was running the command.
Here is the directory structure:

I was able to directly stop the mariadb and traefik server using the command you provided.

docker stop traefik_traefik_1 mariadb-database

Not sure why redis will not stop and why they all will not stop the same way erpnext-one stopped.