Install ERPNext from forked version

Hi All,

We have some very specific requirements for customisation and sometimes need to edit the core files, I’ve tried custom apps but its not fully compatible with what we need for some reason.

I am trying to install ERPNext from my own GitHub so that when I do a bench update it doesn’t overwrite all the changes that I’ve made, I’ve tried to set the remote URLs and have managed to pull ERPNext from my own repo, but when trying to install it on a site it always fails.

Has anyone done this successfully? Can anyone tell me what bench commands I need to run to install from my own GitHub?

Thank you all!

I’ve tried using

bench get-app erpnext <git url of your erpnext fork>
bench --site <sitename> install-app erpnext

but get the following error when trying to install
Installing erpnext…
An error occurred while installing erpnext:
(‘Module Def’, ‘Accounts’, IntegrityError(1062, “Duplicate entry ‘Accounts’ for key ‘PRIMARY’”))

I’ve done some more searching in the forums and tried bench --site reinstall but now when trying to install ERPNext I get the below error, does anyone have the correct way to do this? step by step would be really helpful as I’m still new to this

Installing erpnext…
Updating DocTypes for erpnext : [ ] 0%An error occurred while installing erpnext:
Module import failed for Sales Taxes and Charges Template (erpnext.accounts.doctype.sales_taxes_and_charges_template.sales_taxes_and_charges_template Error: cannot import name ‘clear_cache’ from ‘frappe.website.utils’ (/home/infinics/infinics-bench/apps/frappe/frappe/website/utils.py))
infinics@il-ff01:~/infinics-bench/apps$

Did you check that “same” version (from upstream) install correctly ?

Sorry, I’m not sure what you mean.

I have the latest versions so i’m assuming its installing develop branch for everything, is that what you mean?

You use a forked version as source repository, that it’s ?
What source branch this fork is base on version-12, version-13 or develop ?

Sometimes, depending of state of art, develop branch can be unstable and impossible to install.
I never experience it with version-12 or version-13.

The errors you report, mean during import accounting code, there is a data constraint that is not possible. The root cause can be your forked repository, or standard bug.

1 Like

I forked all the code but I think it defaults to Develop.

I have tried to force it to install version-13 but still get the same errors, I think it might be a bug actually because I am trying to reinstall Frappe now and it keeps giving errors

Have you installed the ERPNext on your site before?
The error could be from an already populated database.
The solution options are:

  • go to database directly and delete the db entry mentioned in the error.
  • uninstall-app ERPNext, and install again from your repo (you will lose all your ERPNext related data)

If I’m not mistaken, if you already have ERPNext installed (from other repo) and you want to change to your repo, you can use command bench remote-set-url to change the git url.

I have installed Frappe and ERPnext before but this is a fresh install on a new server, I have tied remote-set-url but cant find any documentation for it so I’m not sure if i’m doing it correctly