Internal Server Error after restoring database

Hi Everyone,

Please note, I just restore a backup of my live instance running on AWS to my local server and after restoring the database my ERP stopped working.

When I tried:
localhost/ or localhost:8000 or localhost:80 or localhost:8080

It is giving me the following error message:

Internal Server Error

Any help in this context will be appreciated.

Ruchin Sharma

Hi @ruchin78,
try bench migrate
and restrart the service supervisor and nginx

Sagar Shiragawakar
New Indictrans Technologies Pvt Ltd.

1 Like

After doing

bench migrate

I got the below error:

vishnu@vishnu-VirtualBox:~/frappe-bench$ bench migrate
Migrating site1.local
Traceback (most recent call last):
File “/usr/lib/python2.7/”, line 162, 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/vishnu/frappe-bench/apps/frappe/frappe/utils/”, line 79, in
File “/home/vishnu/frappe-bench/apps/frappe/frappe/utils/”, line 16, in main
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 716, in call
return self.main(*args, **kwargs)
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 696, in main
rv = self.invoke(ctx)
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/”, line 205, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/”, line 27, in migrate
File “/home/vishnu/frappe-bench/apps/frappe/frappe/modules/”, line 23, in run_all
for patch in get_all_patches():
File “/home/vishnu/frappe-bench/apps/frappe/frappe/modules/”, line 37, in get_all_patches
patches.extend(frappe.get_file_items(frappe.get_pymodule_path(app, “patches.txt”)))
File “/home/vishnu/frappe-bench/apps/frappe/frappe/”, line 637, in get_pymodule_path
return os.path.join(os.path.dirname(get_module(scrub(modulename)).file), *joins)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/”, line 599, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python2.7/importlib/”, line 37, in import_module
ImportError: No module named library

Ruchin Sharma

hi @ruchin78,
please check library app is installed or not in new site

Sagar Shiragawakar
New Indictrans Technologies Pvt Ltd.

Hi Sagar,

Actually in my live instance (from where I have taken the backup) there are 2 sites
site1.local and

and there are 2 apps
erpnext &

Whereas in the local server (where I am restoring the backup) I have only one default site i.e. site1.local and one default app i.e., erpnext.

Does it required to install the same site and app in the local server as well?
I am asking this question because, I don’t have any idea about it and I am restoring the backup very first time.

If it is required to install the library site as well as library app then I think, I need to re-install the ERPNext and then restore the backup.

Please correct me, if I am wrong.

Ruchin Sharma