hilinafoodserp@hilinafoodserp:~/frappe-bench$ sudo bench --force --site hilinafoods.com restore 20240909_092401-hilinafoods_com-database.sql.gz
[sudo] password for hilinafoodserp:
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/home/hilinafoodserp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
File “/home/hilinafoodserp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/hilinafoodserp/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/hilinafoodserp/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/home/hilinafoodserp/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/hilinafoodserp/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/hilinafoodserp/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/hilinafoodserp/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/hilinafoodserp/frappe-bench/env/lib/python3.11/site-packages/click/decorators.py”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/hilinafoodserp/frappe-bench/apps/frappe/frappe/commands/init.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/hilinafoodserp/frappe-bench/apps/frappe/frappe/commands/site.py”, line 134, in restore
_restore(
File “/home/hilinafoodserp/frappe-bench/apps/frappe/frappe/commands/site.py”, line 196, in _restore
restore_backup(
File “/home/hilinafoodserp/frappe-bench/apps/frappe/frappe/commands/site.py”, line 248, in restore_backup
if is_partial(sql_file_path):
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/hilinafoodserp/frappe-bench/apps/frappe/frappe/installer.py”, line 795, in is_partial
header = get_db_dump_header(sql_file_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/hilinafoodserp/frappe-bench/apps/frappe/frappe/installer.py”, line 865, in get_db_dump_header
with gzip.open(file_path, “rb”) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/gzip.py”, line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/gzip.py”, line 174, in init
fileobj = self.myfileobj = builtins.open(filename, mode or ‘rb’)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: ‘20240909_092401-hilinafoods_com-database.sql.gz’
Drag the 20240909_092401-hilinafoods_com-database.sql.gz
file into the VS Code window.Right-click on the file tab in VS Code and select “Copy Path”. Use the copied path in your bench
restore command
sudo bench --force --site hilinafoods.com restore /path/to/copied/database.sql.gz
Your database file must be in the frappe-bench directory then this command will execute without error.
OR
You pass the full path of your Database File.
Thank you guys it worked perfectly. It was a lot of help. Much obliged