Recover erpnext site

I accidentally deleted a erpnext site from sites folder in the server. What are the chances that I can recover the site ?

Is the database dropped when we delete site folder?

No, the site database does not get dropped on deleting the site folder… But, the files you had uploaded to the site are stored in this folder and are probably lost for ever…

If you can find the database name of that site, you could backup the site database and restore it on a new site.

you wouldn’t be able to use bench command on that site since you have deleted the site folder. But you can refer to how bench backup command works and do the same…

here is the line of code responsible for the backup of site databases:

Thanks for the heads up . I backed up the database using mysqldump command but unable to restore it using bench command. it is throwing error -
frappe.exceptions.AppNotInstalledError: App erpnext is not installed

but im restoring into a new site with erpnext installed