Hello I am facing an issue for docker volume where I am using frappe-app using docker-compose. I have downloaded and installed hrms on both frontend and backend containers. I want a backup of this volume so that i can attach it.
Bash
docker volume ls
local pwd_db-data
local pwd_logs
local pwd_redis-queue-data
local pwd_sites
local student-api_postgres_dataI created a tar file by using
Bash
docker run --rm \
-v pwd_sites:/source \
-v $(pwd):/backup \
busybox \
sh -c "ls -la /source && tar czvf /backup/sites_backup.tar.gz -C /source ."stopped and removed containers restored the volume and extracted the backup by using
Bash
docker volume create pwd_sites
docker run --rm \
-v pwd_sites:/target \
-v $(pwd):/backup \
busybox \
tar xzvf /backup/sites_backup.tar.gz -C /targetmodified my pwd.yaml (docker compose manifest)
Bash
version: "3"
services:
backend:
image: frappe/erpnext:v15.61.0
volumes:
- pwd_sites:/home/frappe/frappe-bench/sites
# ... (other services)
volumes:
pwd_sites:
external: trueI came up with an error which is
Bash
docker compose -p pwd up -d
WARN[0000] The "ERPNEXT_VERSION" variable is not set. Defaulting to a blank string.
WARN[0000] The "ERPNEXT_VERSION" variable is not set. Defaulting to a blank string.
WARN[0000] The "ERPNEXT_VERSION" variable is not set. Defaulting to a blank string

Sarthak VarshneyRank #46 · 32K reputationPosted May 22, 2025, 12:01 AM EDT
Problem Summary
pwd_sitesvolume to a tar file correctly.docker-composefile to use this restored volume.docker compose -p pwd up -d:WARN[0000] The "ERPNEXT_VERSION" variable is not set. Defaulting to a blank string.Docker Compose is expecting a variable
ERPNEXT_VERSION, likely because yourpwd.yamlor an imported file refers to it like this:image: frappe/erpnext:${ERPNEXT_VERSION}But since it's not set in your environment, it defaults to an empty string — which is why you're seeing this warning.
Fix the Warning
Option 1: Set the Variable in a
.envFileCreate a file named
.envin the same folder as yourdocker-composefile (e.g.,pwd.yaml) and add:Docker Compose will automatically load variables from
.env.Option 2: Set it in the shell before running
export ERPNEXT_VERSION=v15.61.0 docker compose -p pwd up -dValidating Your Volume Restoration
After you
docker volume createandtar xzvfinto the volume, it's a good idea to check if the expected files are there:docker run --rm -v pwd_sites:/target busybox ls -la /targetYou should see your
apps.txt,sites/common_site_config.json, and the HRMS app folder in/target/apps.