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.
docker volume ls
local pwd_db-data
local pwd_logs
local pwd_redis-queue-data
local pwd_sites
local student-api_postgres_data
I created a tar file by using
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
docker volume create pwd_sites
docker run --rm \
-v pwd_sites:/target \
-v $(pwd):/backup \
busybox \
tar xzvf /backup/sites_backup.tar.gz -C /target
modified my pwd.yaml (docker compose manifest)
version: "3"
services:
backend:
image: frappe/erpnext:v15.61.0
volumes:
- pwd_sites:/home/frappe/frappe-bench/sites
# ... (other services)
volumes:
pwd_sites:
external: true
I came up with an error which is
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 VarshneyPosted May 22, 2025, 4:01 AM
Problem Summary
pwd_sitesvolume to a tar file correctly.docker-composefile to use this restored volume.docker compose -p pwd up -d:Docker Compose is expecting a variable
ERPNEXT_VERSION, likely because yourpwd.yamlor an imported file refers to it like this: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
Validating Your Volume Restoration
After you
docker volume createandtar xzvfinto the volume, it's a good idea to check if the expected files are there:You should see your
apps.txt,sites/common_site_config.json, and the HRMS app folder in/target/apps.