Database restore Error

hello guys,

i have been trying to restore a backup since yesterday but i keep getting the same error as shown below.

Traceback (most recent call last):
File “/usr/lib/python2.7/”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 97, in
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 18, in main
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 115, in restore
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 65, in new_site
admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 42, in install_db
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 192, in connect
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 1017, in get_attr
(“App {0} is not installed”).format(app_name), AppNotInstalledError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 355, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 341, in msgprint
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 314, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.AppNotInstalledError: App erpnext is not installed

I have ErpNext running on the instance already and i dont know why i keep getting this. Any help will be appreciated.


Do you have multiple sites under your bench, if so can you add --site to backup the one site you want to backup?

Yes i have multiple site.

I used the command below to restore

Bench --site [site] --force restore /sql path

and i have been getting that result. every other sites are functioning well just this.
I have the SQL file from the backup

OK, in that case I would restore the dump on a fleshly created site, just to ensure the dump itself has no problem

This also i have tired.
Initially, i installed an existing site and it crashed the whole Site, which was why i had to create another site and try but still the same thing

hello guys,

this has been resolved. i found my way around it.
i was able to admit that the backup was corrupted so i downloaded again and i used gunzip command to unzip the file and it worked fine for me.

Thanks for the Support