ERPNext instance not working after restoring database of another instance

Hi Everyone,
I just restored the database from one instance to another instance but after restoring my new instance is not working. Below is the error I am receiving:
Traceback (innermost last):
File “/home/ruchin/frappe-bench/apps/frappe/frappe/website/render.py”, line 25, in render
data = render_page_by_language(path)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/website/render.py”, line 91, in render_page_by_language
return render_page(path)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/website/render.py”, line 107, in render_page
return build(path)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/website/render.py”, line 114, in build
return build_page(path)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/website/render.py”, line 127, in build_page
context = get_context(path)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/website/context.py”, line 16, in get_context
context = build_context(context)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/website/context.py”, line 54, in build_context
ret = module.get_context(context)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/templates/pages/desk.py”, line 21, in get_context
boot = frappe.sessions.get()
File “/home/ruchin/frappe-bench/apps/frappe/frappe/sessions.py”, line 106, in get
bootinfo = get_bootinfo()
File “/home/ruchin/frappe-bench/apps/frappe/frappe/boot.py”, line 31, in get_bootinfo
bootinfo[‘user_info’] = get_fullnames()
File “/home/ruchin/frappe-bench/apps/frappe/frappe/boot.py”, line 118, in get_fullnames
from tabUser where enabled=1 and user_type!=“Website User” “”", as_dict=1)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/database.py”, line 147, in sql
self._cursor.execute(query)
File “/home/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (1054, “Unknown column ‘full_name’ in ‘field list’”)

I appreciate if anyone can help me.

@ruchin78 I receive this error, whe my database is blank!

Access the mysql and check if the tables are already there! If yes! use bench migrate

Hi @max_morais_dmm
I tried to access but no table exists.

Regards
Ruchin Sharma

I tried, re-installing ERPNext and got the below error. Can anybody help me?

ruchin@DT013-Inspiron-620s:~$ sudo bash setup_frappe.sh
Installing for Ubuntu vivid amd64
In case you encounter an error, you can post on https://discuss.frappe.io

Adding ubuntu mariadb repo
Installing packages for Ubuntu. This might take time…
Installing wkhtmltopdf
Installing wkhtmltox package for trusty (Ubuntu 14.4) even if you are using vivid.
Adding frappe user
Installing frappe-bench
Setting up first site
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/ruchin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/ruchin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/ruchin/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/ruchin/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/ruchin/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/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/commands.py”, line 69, in new_site
_new_site(db_name, site, mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password, admin_password=admin_password, verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
File “/home/ruchin/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/ruchin/frappe-bench/apps/frappe/frappe/installer.py”, line 32, in install_db
create_database_and_user(force, verbose)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/installer.py”, line 50, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File “/home/ruchin/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 526, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/ruchin/frappe-bench/apps/frappe/frappe/database.py”, line 106, in sql
self.connect()
File “/home/ruchin/frappe-bench/apps/frappe/frappe/database.py”, line 52, in connect
use_unicode=True, charset=‘utf8’)
File “/home/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
return Connection(*args, **kwargs)
File “/home/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 193, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, “Access denied for user ‘root’@‘localhost’ (using password: YES)”)

Do don’t need to run setup_frappe.sh to reinstall

just do bench --site [sitename] restore database.sql --force

Then bench --site [sitename] migrate

1 Like

@rmehta
Tried it but got an error
ruchin@DT013-Inspiron-620s:~/frappe-bench$ bench --site site1.local restore 20160407_2744077_database.sql --force
Error: no such option: --force
ruchin@DT013-Inspiron-620s:~/frappe-bench$ bench --site site1.local restore 20160407_2744077_database.sql
MySQL root password:
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/ruchin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/ruchin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/ruchin/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/ruchin/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/ruchin/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/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/ruchin/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/ruchin/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/commands.py”, line 136, 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/ruchin/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/ruchin/frappe-bench/apps/frappe/frappe/installer.py”, line 32, in install_db
create_database_and_user(force, verbose)
File “/home/ruchin/frappe-bench/apps/frappe/frappe/installer.py”, line 50, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File “/home/ruchin/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 526, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/ruchin/frappe-bench/apps/frappe/frappe/database.py”, line 106, in sql
self.connect()
File “/home/ruchin/frappe-bench/apps/frappe/frappe/database.py”, line 52, in connect
use_unicode=True, charset=‘utf8’)
File “/home/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
return Connection(*args, **kwargs)
File “/home/ruchin/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 193, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2002, ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 “No such file or directory”)’)
ruchin@DT013-Inspiron-620s:~/frappe-bench$

@ruchin78

seems mysql is stopped.

if you are using ubuntu server run sudo /etc/init.d/mysql restart