Getting error on restore

I have gone through previous of similar error but i am not able to find the reason for this error. As i have seen in database from backend that there is not a single table present in database;

bench frappe --restore 8275c88972 …/20150509_76020419_database.sql --force
MySQL root password:
8275c88972 pass 1orkMvcmcJsdux8t host localhost
Created user 8275c88972
Created database 8275c88972
Granted privileges to user 8275c88972 and database 8275c88972
Starting database import…
sh: 1: cannot open …/20150509_76020419_database.sql: No such file
Imported from database …/20150509_76020419_database.sql
Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/env/bin/frappe”, line 9, in
load_entry_point(‘frappe==4.14.1’, ‘console_scripts’, ‘frappe’)()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/cli.py”, line 53, in main
return run(fn, parsed_args)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/cli.py”, line 81, in run
out = globals().get(fn)(*args.get(fn), **args)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/cli.py”, line 67, in new_fn
return fn(*args, **new_kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/cli.py”, line 386, in restore
_install(db_name, source_sql=source_sql, quiet=quiet, force=force)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/cli.py”, line 319, in _install
install_app(“frappe”, verbose=verbose, set_as_patched=not source_sql)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 93, in install_app
frappe.clear_cache()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 287, in clear_cache
frappe.sessions.clear_cache()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/sessions.py”, line 49, in clear_cache
for sess in frappe.db.sql(“”“select user, sid from tabSessions”“”, as_dict=1):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py”, line 121, in sql
self._cursor.execute(query)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1146, “Table ‘8275c88972.tabSessions’ doesn’t exist”)

Hi Pdvyas
Thanks i restored directly from mysql database. But now i am getting 500 ERROR.
I have taken backup from frappecloud and restore that it on my local machine.

response = frappe.website.render.render(request.path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/render.py”, line 47, in render
data = render_page(path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/render.py”, line 105, in render_page
return build(path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/render.py”, line 114, in build
return build_method(path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/render.py”, line 124, in build_json
return get_context(path).data
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/context.py”, line 28, in get_context
context = get_route_info(path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/router.py”, line 18, in get_route_info
sitemap_options = build_route(path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/router.py”, line 44, in build_route
app_base = frappe.get_hooks(“base_template”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 464, in get_hooks
hooks = _dict(cache().get_value(“app_hooks”, load_app_hooks))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/memc.py”, line 21, in get_value
val = builder()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 441, in load_app_hooks
app_hooks = get_module(app + “.hooks”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 379, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named frappe_subscription.hooks

Please follow the latest instructions:

1 Like

Thank Rmehta
I have my machine up with V4 version with production implementation. Then i took backup from Frappecloud and restored on my machine. Once i updated db and restart the Nginx.
I am getting this Error.

“File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named frappe_subscription.hooks”

My machine is V4 version, i didnt moved to v5 now. I am planning to move after successful running of backup on V4.
Correct me if i am missing any step.

And its mentioned in the thread which u have given me that it will work only i run install_script before 25March, but i have used it now.

Hi Rishabh
I am firstly trying to install ERPNext on my machine.
Then i am trying to switch to V4 and restore backup from frappecloud.
I am getting this error while restore.

frappe app is not installed. Run the following command to install frappe
bench get-app frappe GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/ubuntu/bench-repo/bench/cli.py”, line 42, in cli
return old_frappe_cli()
File “/home/ubuntu/bench-repo/bench/cli.py”, line 94, in old_frappe_cli
os.execv(f, [f] + sys.argv[2:])
OSError: [Errno 2] No such file or directory