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/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, 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/core.py”, 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/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 115, in restore
force=context.force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, 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/installer.py”, line 42, in install_db
frappe.connect(db_name=db_name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 192, in connect
get_attr(hook)()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1017, in get_attr
throw(
(“App {0} is not installed”).format(app_name), AppNotInstalledError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 355, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 341, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, 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.

Thanks

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