Install version 4

Here is my issue.

I had a version 4 running, with a dailly backup.
Somehow we messed up the entire server, causing us to completely reinstall the server (Ubuntu Server 14.04 LTS)
Now we have to install version 4 again so we can restore the backup, and then update to version 5.

When I try ‘bench init --frappe-branch v4.x.x frappe-bench’, I get an error saying “DistributionNotFound(reg)”

Can anyone help us ?

You can try using this version of the script: bench/setup_frappe.sh at 05a27304dd488feae25d9782b6f7c7b549a99ab7 · frappe/bench · GitHub

with one modification, replace the ERPNEXT_APPS_JSON variable with a path to json with branch as v4.x.x

reference of the JSON: bench/erpnext-apps-master.json at v5.0 · frappe/bench · GitHub

Hi,

During installation I get following error message.

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/benjamien/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 77, in
main()
File “/home/benjamien/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 14, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 664, in call
return self.main(*args, **kwargs)
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 644, in main
rv = self.invoke(ctx)
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/home/benjamien/frappe-bench/apps/frappe/frappe/commands.py”, line 68, 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/benjamien/frappe-bench/apps/frappe/frappe/commands.py”, line 86, 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/benjamien/frappe-bench/apps/frappe/frappe/installer.py”, line 31, in install_db
create_database_and_user(force, verbose)
File “/home/benjamien/frappe-bench/apps/frappe/frappe/installer.py”, line 49, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File “/home/benjamien/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 421, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/benjamien/frappe-bench/apps/frappe/frappe/database.py”, line 105, in sql
self.connect()
File “/home/benjamien/frappe-bench/apps/frappe/frappe/database.py”, line 51, in connect
use_unicode=True, charset=‘utf8’)
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
return Connection(*args, **kwargs)
File “/home/benjamien/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)”)
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/benjamien/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 77, in
main()
File “/home/benjamien/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 14, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 664, in call
return self.main(*args, **kwargs)
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 644, in main
rv = self.invoke(ctx)
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/benjamien/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/home/benjamien/frappe-bench/apps/frappe/frappe/commands.py”, line 28, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/benjamien/frappe-bench/apps/frappe/frappe/commands.py”, line 159, in install_app
for site in context.sites:
TypeError: ‘NoneType’ object is not iterable

Can we install version 5 and upgrade our database backup from version 4 to version 5 ?

I just installed version 5
Then I restored my version 4 database and ran bench update --patch
This looked like it workerd.

But my browser now shows "Updating. We will be back in a few moments… "
How can I resolve this ?

When we run other bench commands, we get an error saying “‘module’ object is not callable”

We did a complete fresh install with version 5.
Everything is working with an empty database from the fresh install.
We tried to restore the version 4 backup to this database, and ran “bench update --patch”
This gives us the error “‘module’ object is not callable” and nothing is working anymore.

We we then restore the empty database and ran the “bench update --patch” everything is working again but with the empty database.

How can we restore the version 4 database to our version 5 installation ?
Your help is very much appreciated because this is our live environment and all our company data is in there.

Thanks,
Benjamien

You can restore a v4 database and run bench update to convert it to the latest version.

@betoled If you need this urgent you should get some professional help you fix this for you.

I downloaded the VirtualBox image and restored our V4 database over the erpnext database.
Then i ran bench update and got an error.
I also tried bench switch-to-develop, bench update, bench retry-upgrade, but I always get the same error.

From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch develop → FETCH_HEAD
    Already up-to-date.
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch develop → FETCH_HEAD
    Already up-to-date.
    Migrating erpnext.erpnext-vm
    Executing frappe.patches.v5_0.rename_table_fieldnames in erpnext.erpnext-vm (erpnext)
    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/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 77, in
    main()
    File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 14, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 664, in call
    return self.main(*args, **kwargs)
    File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 644, in main
    rv = self.invoke(ctx)
    File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
    return callback(*args, **kwargs)
    File “/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py”, line 28, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py”, line 205, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
    if not run_single(patchmodule = patch):
    File “/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/erpnext/frappe-bench/apps/frappe/frappe/patches/v5_0/rename_table_fieldnames.py”, line 32, in execute
    rename_field(dt, field[0], field[1])
    TypeError: ‘module’ object is not callable
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
    File “/home/erpnext/bench-repo/bench/cli.py”, line 55, in cli
    bench()
    File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 610, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 590, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 416, in invoke
    return callback(*args, **kwargs)
    File “/home/erpnext/bench-repo/bench/cli.py”, line 263, in retry_upgrade
    patch_sites()
    File “/home/erpnext/bench-repo/bench/utils.py”, line 118, in patch_sites
    run_frappe_cmd(‘–site’, ‘all’, ‘migrate’, bench=bench)
    File “/home/erpnext/bench-repo/bench/utils.py”, line 427, in run_frappe_cmd
    subprocess.check_call((f, ‘-m’, ‘frappe.utils.bench_helper’, ‘frappe’) + args, cwd=sites_dir)
    File “/usr/lib/python2.7/subprocess.py”, line 511, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command ‘(’/home/erpnext/frappe-bench/env/bin/python’, ‘-m’, ‘frappe.utils.bench_helper’, ‘frappe’, ‘–site’, ‘all’, ‘migrate’)’ returned non-zero exit status 1

Please help to resolve this.

Hi,

I have not problem paying for help, but can you point me to someone that can help me and maybe tell me what it would cost to get this resolved ?