Restore Backup From system cloud to local machine

Dear all,

We have Erpnext system on cloud,And we are looking to have erpnext on local machine to avoid any thing happend on the orginal system ,so i take backup from the system and trying to restore backup on the local machine using Vmware and ubuntu 15.10 and used the following command :

bench --site [sitename] --force restore /path/to/SQLFILE
bench --site [sitename] migrate

and the server goes down “Internal Server Error”

is that possible to restore backup from cloud system to local machine ?

Yes it is possible. Can you please check the log files for errors

MySQL root password:
ERROR: Can’t initialize batch_readline - may be the input source is a directory or a block device.
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, 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/erpnext-test/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/erpnext-test/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/erpnext-test/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/erpnext-test/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext-test/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext-test/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/erpnext-test/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/erpnext-test/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/erpnext-test/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/commands.py”, line 130, in restore
_new_site(db_name, site, mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password, admin_password=admin_password, verbose=context.verbose, install_apps=install_app, source_sql=sql_file_path, force=context.force)
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/commands.py”, line 87, in _new_site
install_db(root_login=mariadb_root_username, root_password=mariadb_root_password, db_name=db_name, admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/installer.py”, line 38, in install_db
remove_missing_apps()
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/installer.py”, line 296, in remove_missing_apps
installed_apps = json.loads(frappe.db.get_global(“installed_apps”) or “[]”)
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/database.py”, line 641, in get_global
return self.get_default(key, user)
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/database.py”, line 653, in get_default
d = self.get_defaults(key, parent)
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/database.py”, line 659, in get_defaults
defaults = frappe.defaults.get_defaults(parent)
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/defaults.py”, line 72, in get_defaults
globald = get_defaults_for()
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/defaults.py”, line 177, in get_defaults_for
where parent = %s order by creation""", (parent,), as_dict=1)
File “/home/erpnext-test/frappe-bench/apps/frappe/frappe/database.py”, line 135, in sql
self._cursor.execute(query, values)
File “/home/erpnext-test/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/erpnext-test/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1146, “Table ‘12d1ea37ad.tabDefaultValue’ doesn’t exist”)

Any Help

Seems your db file / path could be incorrect

and how to fix it

kindly any help