I have installed local docker and everything is working fine. Using the official guide on github.
I have my database downloaded, how do i use the backup to restore the site ?
Youâve to get the files available in container with erpnext-worker image.
- use
docker cp
command to copy files from host machine to running container - use docker run command to start a new container. Mount volume backup files, sites-vol (for configuration and sites) and run the backup / restore / new-site command
There are two approaches here: you can do backup/restore at the container level with dockerâs mechanisms, or you can do it at the site level using frappeâs mechanisms. If youâve got a database backup made using frappeâs bench backup
command, the easiest way to restore is to use bench restore
:
https://frappeframework.com/docs/v13/user/en/bench/reference/restore
tnx for taking your time and answering my novice questions all the time
sry but I have no idea what that means
tried restore in frappe container, no success.
I think I donât know which container i must run it in.
Hi,
I think you are on the right container, but you used the order resotre instead of restore
Hope this helps, regards
Alb
Hi,
I think you would need to locate the backups inside the volume that contains the actual site.
That from memory it should be located (at least it is in there on my Ubuntu installation) in /var/lib/docker/volumes/âthe name of your site volumeâ
Yes, on my case it is in: /var/lib/docker/volumes/your-project-name_sites-vol/_data
And for the restore I generally locate the files on backup folder just under _data that I delete later and do:
bench --site erp.yourdomain.com restore ./backup/database.sql.gz --with-public-files ./backup/files.tar --with-private-files ./backup/private-files.tar
Well that did the trick and i was able to restoreâŚ
the bad news is the site is down with internal server error
check log for erpnext-python container
If it was permission error before, then make sure contents under sites-vol are owned by uid:gid 1000:1000
execute:
cd _data
chown -R 1000:1000 .
Well I did nothing extra and gave up, after a restart i saw that some containers stopped, so i started them and everything is fine.
Hi,
I also want to restore the files backup from eprnext version 13.0 to version 13.20 installed on another machine. My 1st question is can I do so? And my 2nd question is I have the docker version of erpnext and will the bench command still work? When I tried to run the restore command it presented an error:
var/lib/docker/volumes/frappe_docker_sites-vol/_data#
bench --site erp.domainname.com restore ./erpx_file_backup/database.sql.gz --with-public-files ./erpx_file_backup/files.tar --with-private-files ./erpx_file_backup/private-files.tar
Command âbenchâ not found, did you mean:
command âtbenchâ from deb dbench (4.0-2build1)
command âdbenchâ from deb dbench (4.0-2build1)
Try: apt install
Do I have to install bench?
just changing working directory to the location of volume on the host machine wonât make it execute commands from the container.
use docker exec
to run commands from container.
OK. Thanks!
Thank you!
I get following message after running
~/frappe-bench/sites$ bench --site erp.insertyoursitehere.com restore ./backup/database.sql.gz --with-public-files ./backup/files.tar --with-private-files ./backup/private-files.tar
inside the container:
/bin/sh: 1: cannot create /home/frappe/frappe-bench/sites/backup/database.sql: Permission denied
Could you assist with this?
You might need to pass the database password as well:
Execute the restore command using bench
bench --site â$SITE_NAMEâ restore â$DB_FILE_PATHâ
âwith-public-files â$PUBLIC_FILES_PATHâ
âwith-private-files â$PRIVATE_FILES_PATHâ
âdb-root-username â$DB_ROOT_USERNAMEâ
âdb-root-password â$DB_ROOT_PASSWORDâ