Please help about how i can take backup on my ERPNEXT . and restore
Hi @zee.malik2008,
For public and private file for:
bench --site {site} backup --with-files
and Restore for:
bench restore [OPTIONS] SQL_FILE_PATH
or Restore a site with files
bench --site {site} restore {path/to/database/file} --with-public-files {path/to/public/archive} --with-private-files {path/to/private/archive}
More Details for check it:
bench backup: bench backup
bench restore: bench restore
Any suggestion for check it topic:
Thank You!
What if I just want to restore the private and pubic file? The database has already been restored??
Hi @NCP When I took a backup, I noticed an additional file was generated in erpnext version 15:
20260106_233505-demo_site_net-site_config_backup.json
I understand this is a backup of the site’s site_config.json.
Could you please clarify:
-
What is the exact purpose of this
site_config_backup.jsonfile? -
Can it be used for restoring a site?
-
If yes, what is the correct way to use it during or after a restore?
If you restore a site, you will likely need to restore the site_config.json as well. That’s why it gets backed up. There are configuration options stored in there that aren’t kept in any other place.
In addition to what others have mentioned, I’ll say the site_config.json is a handy bit of info. Yes it can be critical for managing backups becuase it contains the DB password and possible the encryption key for other database encrypted fields.
What makes it handy is… you can modify the site_config.json before restoring a site. You can change the database username (which is also the database name), and host_name, allowing you to restore a clone for testing and other purposes.