Upgrade strategies v8 -> v14

Hello All,

I have a ERPNext: v8.7.2 deployment, and I would like to upgrade to the latest stable v14 version.

What is the recommended upgrade procedure these days? I have tried setting up a new erpnext server, creating a new site, and doing a --force restore from a backup of my v8 deployment. This promptly fails due to a missing tabDocType State table. I did try manually creating that table, but there’s a subsequent error. This strategy does not seem like the correct path.

Thank you,
-Jev

1 Like

@jev Welcome to the community! :confetti_ball: :tada:

ERPNext does not encourage and practically does not allow leap upgrades. you have to follow this order:

v8 → v9 → v10 → v11 ->v 13 → v14. The only exception in this sequence is 11 → 13. Possibly because no major database refactoring happened between 12 and 13 so nothing breaks. If you don’t follow this sequence you will miss the database refactoring that occurred with every major version release which means your database would not be refactored to meet the schema of the current version.

It’s a lot of work especially considering this also involves setting your environment including OS version and packages to meet the specific requirements for those versions.

Anyway, best of luck on your upgrade journey.

Thank you @flexy2ky

So if I understand you correctly, I should use the bench install, something along the lines of;

  • bench update
  • bench switch-to-branch v8.x.x (Is it correct to use the x.x tags here?)
  • bench update --patch

And I repeat this for tags v9.x.x up to v14.x.x ?

Is there some consistency check command that I can run at the end of each update?

Thank you,

The process may not always be the same for each version. In some cases you may have to install that version and restore backup from the previous version (although this is not advisable) but quick searches in the forum will throw up some threads about the upgrade process for each version.

Good day @jev and welcome

Just curious … on what OS are you running your ERPNext 8.7.2 ?

This is running on “Ubuntu 16.04.3 LTS”

I have had some success getting updated to V11; here’s the process for updating the system “in-situ” using bench. I suspect some steps are redundant, and some are specific to my system.

  • Upgrading ERPNext
    • to the latest v8.x.x release
      • cd ~/.bench ; git checkout – .
      • cd ~/frappe-bench
      • bench update
      • (cd apps/erpnext ; git checkout --)
      • bench switch-to-branch v8.x.x
      • source env/bin/activate
      • pip install PyPDF2 pyotp==2.2.5 pyqrcode
      • bench update --patch --no-backup
      • bench update --no-backup
    • v9.x.x
      • bench switch-to-branch v9.x.x --upgrade
      • sudo apt-get -f install
      • sudo apt-get install postgresql
      • pip install boto3==1.9.45 urllib3==1.23 chardet==3.0.4 psycopg2==2.7.7
      • bench update --patch --no-backup
      • bench update --no-backup
    • v10.x.x
      • bench switch-to-branch v10.x.x --upgrade
      • bench update --patch --no-backup
      • bench update --no-backup
    • v11.x.x
      • bench switch-to-branch version-11 --upgrade
      • bench update --patch --no-backup
      • bench update --no-backup

From V11, I think I will need to export the site (db and files) and import it into a fresh install using bench and docker. The current OS is outdated, and I believe v12 switched to Python 3.x.

My work is all on a copy of the system, so my experiments are strictly in the testing phase.

Presently, I’m getting some JS errors when trying to save some doctypes; for example when trying to save a Material Request doc, I get this error:

Uncaught (in promise) TypeError: erpnext.utils.copy_value_in_all_rows is not a function
    at set_schedule_date (eval at setup (form.min.js?ver=1683840486.0:2687:14), <anonymous>:1188:17)
    at Class.schedule_date (eval at setup (form.min.js?ver=1683840486.0:2687:14), <anonymous>:1179:3)
    at runner (form.min.js?ver=1683840486.0:2624:41)
    at form.min.js?ver=1683840486.0:2651:13

Someone else reported this issue here, but there was no solution posted. Any tips are welcome.

I’m also getting errors on various DocumentType pages about unrecognized column names. Here’s an example;

InternalError: (1054, u"Unknown column 'tabSales Invoice.material_request' in 'where clause'")

I’m wondering how these changes weren’t addressed in the migration steps. I believe bench migrate gets run as part of bench update. I did try bench migrate separately, and cleared cache, restart/reload etc.

I have always found that a bench update --reset succeeds more often

If you’ve gotten to v11 on Ubuntu 16.04 then upgrade the OS to 18.04 and you’ll be able to make the jump to v13 from v11 using the bench switch-to-branch command. Then you have to set up a new instance and then make the leap from v13 - v14.

1 Like

Thanks for the suggestions. Yes, upgrading the OS might be a good path, but first, I want to resolve the various application errors I encounter.

I’m seeing; the erpnext.utils.copy_value_in_all_rows is not a function error in the browser console frequently.

I’m also getting unknown column in where clause in several places.

update --reset didn’t help. I don’t have any local code customizations, and any of the javascript scripts I have are for specific DocTypes. I’m seeing errors on DocTypes that I have not custom javascript code for.

Thanks,

I found the issue. During the updates, I missed that yarn/npm builds were failing, and so I had old javascript assets. In the case of copy_value_in_all_row, that was renamed at some point to copy_value_in_all_rows.

Installing yarn globally, and running;
bench setup requirements
bench build

Rebuilt all the latest assets. I’ll proceed with the upgrade, and post the final process that works for me, so that it can be useful to others.