Answers.Body: <p>After some chat on MM we identified that the installation had a file <code>CRM/Upgrade/Incremental/FourOne.php</code>   That file has been removed from the current release but the usual Joomla upgrade process extracts the CiviCRM zip file into the existing code directories rather than removing them first.  This is fine for new and changed files but does not delete files no longer in the released code.</p>
  <p>The <a href="https://docs.civicrm.org/sysadmin/en/latest/upgrade/joomla/#install-the-extension" rel="noreferrer">Joomla upgrade documentation</a> notes that sometimes it is necessary to uninstall and reinstall.  This removes all the old files before installing the new ones.  This should not affect the database but note @minbori's comment above that permissions needed to be reset afterwards. (It would be useful if someone could verify what happens to permissions and add a note to the documentation accordingly.)</p>
  <p>Alternatively for those with filesystem access the <code>administrator/components/com_civicrm/civicrm</code> can be deleted and the installation zip file manually extracted to put the new files in place. (See @demerit's comment above.)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-15T00:06:44.617Z
Answers.Text: This works perfectly.  Thanks!
Answers.UserDisplayName: CiviTeacher
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-16T19:58:38.860Z
Answers.Text: As per thoni56's answer below (which builds on this answer), removing the old Three---- and Four---- files from civicrm/CRM/Upgrade/Incremental/php/ solves the problem without a complete Civi uninstall/reinstall. Possibly just removing FourOne.php will do the trick.
Answers.UserDisplayName: Phil Morice Brubaker
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-12T14:45:44.693Z
Answers.LastActivityDate: 2021-05-12T14:45:44.693Z
Answers.UserDisplayName: Aidan
Answers.Body: <p>We also experienced the same problem when upgrading from 5.36.1 to 5.37.2.</p>
  <p>Inspired by <a href="https://civicrm.stackexchange.com/a/39546/354">the answer from Aidan</a> I went and looked in <code>civicrm/CRM/Upgrade/Incremental/php/</code> and found a few files with old dates and named <code>Three????.php</code> and <code>Four????.php</code>.</p>
  <p>As I was protected by a smoking fresh total Akeeba backup (running on Joomla) I ventured to just move those files to a safe place and retry the update.</p>
  <p>And it worked!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-27T16:10:11.753Z
Answers.Text: This worked perfectly for me as well, thanks.
Answers.UserDisplayName: Troy Mumm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-16T19:56:14.017Z
Answers.Text: Confirm that removing the old Three---- and Four---- files solves the problem without a complete Civi uninstall/reinstall. Possibly just removing FourOne.php will do the trick.
Answers.UserDisplayName: Phil Morice Brubaker
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-27T15:14:25.763Z
Answers.LastActivityDate: 2021-05-27T15:14:25.763Z
Answers.UserDisplayName: thoni56
Answers.Body: <p>I was having exactly the same error on a site that I had not upgraded for a long time. I do have access to the filesystem.</p>
  <p>I followed your instructions and I deleted the folder administrator/components/com_civicrm/civicrm and I extracted the administrator/components/com_civicrm/civicrm.zip file. This created a new administrator/components/com_civicrm/civicrm folder.</p>
  <p>I then rerun the Upgrade Database with <a href="https://domainname.com/administrator/index.php?option=com_civicrm&amp;task=civicrm/upgrade&amp;reset=1" rel="nofollow noreferrer">https://domainname.com/administrator/index.php?option=com_civicrm&amp;task=civicrm/upgrade&amp;reset=1</a></p>
  <p>and this time I was able to start the upgrade process.</p>
  <p>Unfortunately in the middle of the upgrade I got the following error:</p>
  <p>[Error: Update smart groups to rename filters on case_from and case_to to case_start_date and case_end_date]</p>
  <p>CiviCRM_API3_Exception: &quot;DB Error: no such field&quot;</p>
  <p>#0 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Incremental/SmartGroups.php(206): civicrm_api3(&quot;SavedSearch&quot;, &quot;create&quot;, (Array:3))
  #1 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Incremental/SmartGroups.php(27): CRM_Upgrade_Incremental_SmartGroups-&gt;renameField(&quot;event_start_date_low&quot;, &quot;event_low&quot;)
  #2 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Incremental/Base.php(273): CRM_Upgrade_Incremental_SmartGroups-&gt;updateGroups((Array:1))
  #3 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Task.php(74): CRM_Upgrade_Incremental_Base::updateSmartGroups(Object(CRM_Queue_TaskContext), (Array:1))
  #4 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Runner.php(201): CRM_Queue_Task-&gt;run(Object(CRM_Queue_TaskContext))
  #5 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php(36): CRM_Queue_Runner-&gt;runNext(TRUE)
  #6 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/ErrorPolicy.php(89): CRM_Queue_Page_AJAX::{closure}()
  #7 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php(38): CRM_Queue_ErrorPolicy-&gt;call(Object(Closure))
  #8 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(279): CRM_Queue_Page_AJAX::runNext()
  #9 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:13))
  #10 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:5))
  #11 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm.php(121): CRM_Core_Invoke::invoke((Array:5))
  #12 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm.php(40): civicrm_invoke()
  #13 /home/customer/www/domainname.com/public_html/libraries/src/Component/ComponentHelper.php(402): require_once(&quot;/home/customer/www/domainname.com/public_html/administrator/compo...&quot;)
  #14 /home/customer/www/domainname.com/public_html/libraries/src/Component/ComponentHelper.php(377): Joomla\CMS\Component\ComponentHelper::executeComponent(&quot;/home/customer/www/domainname.com/public_html/administrator/compo...&quot;)
  #15 /home/customer/www/domainname.com/public_html/libraries/src/Application/AdministratorApplication.php(101): Joomla\CMS\Component\ComponentHelper::renderComponent(&quot;com_civicrm&quot;)
  #16 /home/customer/www/domainname.com/public_html/libraries/src/Application/AdministratorApplication.php(159): Joomla\CMS\Application\AdministratorApplication-&gt;dispatch()
  #17 /home/customer/www/domainname.com/public_html/libraries/src/Application/CMSApplication.php(203): Joomla\CMS\Application\AdministratorApplication-&gt;doExecute()
  #18 /home/customer/www/domainname.com/public_html/administrator/index.php(51): Joomla\CMS\Application\CMSApplication-&gt;execute()
  #19 {main}</p>
  <p>And if I try running the upgrade database command again, I get this:</p>
  <p>Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
  Database check failed - the database looks to have been partially upgraded. You may want to reload the database with the backup and try the upgrade process again.</p>
  <p>What do I do now? Doing a quick check, I seem to be able to access my records, but it sounds like I am left with a partially upgraded database!</p>
  <p>I would really appreciate some help. Thanks, Adri</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-13T11:52:59.123Z
Answers.LastActivityDate: 2021-05-13T12:38:15.470Z
Answers.LastEditDate: 2021-05-13T12:38:15.470Z
Answers.UserDisplayName: Adri Cist
Answers.Body: <p>Just an update for anyone else finding themselves in this issue. I have been able to complete manually the Database updates following Eileen suggestions in this post.</p>
  <p><a href="https://civicrm.stackexchange.com/questions/4147/what-can-i-do-to-fix-my-database-that-has-been-partially-upgraded">What can I do to fix my database that has been partially upgraded?</a></p>
  <p>Thanks,
  Adri</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-14T01:38:13.630Z
Answers.LastActivityDate: 2021-05-14T01:38:13.630Z
Answers.UserDisplayName: Adri Cist
Answers.Body: <p>I had the same error, upgrading from  5.35.0. (Joomla) to 5.37.2.
  After renaming the /civicrm directory and extracting the civicrm.zip (and the change l10n for translating) I got errors trying to start the application to execute the upgrade-script (I suppose i had to run the upgrade-script not using the application to do that!).
  But after copying the directories PEAR, MAIL and DB and the same files in com_civicrm\civicrm\packages from the renamed directory to the new version the application worked and the upgrading is done without (shown) errors.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-27T19:22:34.493Z
Answers.LastActivityDate: 2021-05-27T19:22:34.493Z
Answers.UserDisplayName: HanV
Answers.Body: <p>So I went from 5.36.1 to 5.37.2.  I received the same db error.  The only issue I had was that I had to copy /ext to /com_civicrm, delete /civicrm then run civicrm.zip again from the directory, then copy /ext back in. Once I did that I could upgrade the database.  The only issue for me was reCaptcha was missing files, so I delete the extension and tried to reinstall but it was not available. Curious if they integrated that into core or do I just need to look harder.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-13T19:12:55.977Z
Answers.Text: One additional issue cropped up when we deleted the directory, it also deleted and did not reload the reCaptcha directory/files.  So we get the red error screen stating that Class 'CRM_Utils_ReCAPTCHA' not found.  Now I am just waiting for the next issue to pop up due to deleting the civicrm directory.
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-13T15:13:47.450Z
Answers.LastActivityDate: 2021-05-13T15:13:47.450Z
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.Body: <p>I had the problem while updating 5.38.1. I hoped maybe if I did a new update the problem would be fixed. But while updating, I got the same error again. As @toni56 forwarded, I first backup and deleted the files &quot;FourOne.php, FourTwo.php, FourThree.php and FourFour.php&quot; in the &quot;/public_html/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Incremental/php&quot; directory. Then I tried to update with &quot;administrator/?option=com_civicrm&amp;task=civicrm/upgrade&amp;reset=1&quot; and PROBLEM IS SOLVED. Thank you so much.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-10T18:30:20.823Z
Answers.LastActivityDate: 2021-08-10T18:30:20.823Z
Answers.UserDisplayName: Fatih ATEŞ
Body: <p>I'm trying to upgrade CiviCRM in a Joomla 3.9.26 environment from 5.25.0 to 5.37.0.</p>
  <p>I ran the file installation, cleared the media/template_c folder, then tried to run the database upgrade script.  I get this error:</p>
  <pre><code>An error has occurred. 
  0 Call to undefined method CRM_Upgrade_Incremental_php_FourOne::getMajorMinor()
  </code></pre>
  <p>The ConfigLog file and the PHP error logs don't show this error, and the ConfigLog files don't seem to show anything related to any database upgrade script.  Also, the civicrm_domain table still shows 5.25.0 in the version column, so I don't think the update script has run at all.</p>
  <p>I have no idea why this upgrade would be calling a 4.1 incremental upgrade script?  And I'm not sure what steps to take next to recover -- or if I just roll back to my backup. However, I will eventually need to get this upgraded!</p>
  <p>Suggestions appreciated!</p>
  <p>UPDATE: call stack as requested...</p>
  <pre><code>0 Call to undefined method CRM_Upgrade_Incremental_php_FourOne::getMajorMinor()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:125 
  1   ()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:125
  2   CRM_Upgrade_Form::incrementalPhpObjectVersions()    JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:324
  3   CRM_Upgrade_Form-&gt;getRevisionSequence()     JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:845
  4   CRM_Upgrade_Form-&gt;setPreUpgradeMessage()    JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php:108
  5   CRM_Upgrade_Page_Upgrade-&gt;runIntro()    JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php:57
  6   CRM_Upgrade_Page_Upgrade-&gt;run()     JROOT/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:313
  7   CRM_Core_Invoke::runItem()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:69
  8   CRM_Core_Invoke::_invoke()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:36
  9   CRM_Core_Invoke::invoke()   JROOT/administrator/components/com_civicrm/civicrm.php:121
  10  civicrm_invoke()    JROOT/administrator/components/com_civicrm/civicrm.php:40
  11  require_once()  JROOT/libraries/src/Component/ComponentHelper.php:402
  12  Joomla\CMS\Component\ComponentHelper::executeComponent()    JROOT/libraries/src/Component/ComponentHelper.php:377
  13  Joomla\CMS\Component\ComponentHelper::renderComponent()     JROOT/libraries/src/Application/AdministratorApplication.php:101
  14  Joomla\CMS\Application\AdministratorApplication-&gt;dispatch()     JROOT/libraries/src/Application/AdministratorApplication.php:159
  15  Joomla\CMS\Application\AdministratorApplication-&gt;doExecute()    JROOT/libraries/src/Application/CMSApplication.php:203
  16  Joomla\CMS\Application\CMSApplication-&gt;execute()    JROOT/administrator/index.php:51 
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-11T14:28:43.767Z
Comments.Text: Strange!  Can you add the rest of the stacktrace.  That might give a few more clues.
Comments.UserDisplayName: Aidan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-11T15:11:29.760Z
Comments.Text: well Aidan, I need to figure out how to find it. That's the entire message as shown in the Joomla interface, and I don't see anything similar in ConfigLog or the PHP error log.  I'll try to generate it again.
Comments.UserDisplayName: minbori
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-11T15:31:06.487Z
Comments.Text: ok, added. hope that helps -- looks like it's the PHP Incremental versions it's hanging on, not the Civi....but this system is running on PHP 7.4 and has been for quite a while?
Comments.UserDisplayName: minbori
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-11T18:44:08.313Z
Comments.Text: Wondering did you delete and completely replace the `administrator/components/com_civicrm/civicrm` with the new files? For all the CMS's except Joomla you need to do that to avoid problems like this, but one thing I don't understand about joomla is that the civi upgrade instructions don't tell you to do that. I would try completely replacing the civicrm folder with the new files (make a backup in case you have something custom in there - you shouldn't but sometimes people do).
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-12T11:11:58.743Z
Comments.Text: I did not, but via Aidan's suggestion on Mattermost I tried again and did just that: backed up the code base, uninstalled Civi, and reinstalled . I ran into a couple hiccups (had to manually put back my civicrm.settings.php files, and this one https://civicrm.stackexchange.com/questions/39185/crash-in-upgrade-to-5-35-1-on-task-core-issue365-add-created-date-to-civicrm) but everything seemed to update smoothly. However, now it seems the Joomla permissions are borked.  Am researching now and may open another question.
Comments.UserDisplayName: minbori
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-12T11:26:47.663Z
Comments.Text: Just found this as a known issue: https://lab.civicrm.org/dev/core/-/issues/2601 and resolved in 5.37.1 (https://github.com/civicrm/civicrm-core/blob/5.37/release-notes/5.37.1.md).  Will update to 5.37.1 and see if that solves the problem.
Comments.UserDisplayName: minbori
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-12T13:43:32.063Z
Comments.Text: OK upgrading to 5.37.1 went smoothly, and I again have access to the Joomla CiviCRM permissions. However, it seems some of my base permissions have been deleted so I'll need to reset them.  But at least the upgrade is done!
Comments.UserDisplayName: minbori
Tags: <joomla><upgrade><database><failure>
Title: database upgrade script failing: Call to undefined method CRM_Upgrade_Incremental_php_FourOne::getMajorMinor()
ThreadText: # database upgrade script failing: Call to undefined method CRM_Upgrade_Incremental_php_FourOne::getMajorMinor()
  
  (Asked by: username_0 on 2021-05-11)
  
  I'm trying to upgrade CiviCRM in a Joomla 3.9.26 environment from 5.25.0 to 5.37.0.
  
  I ran the file installation, cleared the media/template\_c folder, then tried to run the database upgrade script. I get this error:
  
  ```
  An error has occurred. 
  0 Call to undefined method CRM_Upgrade_Incremental_php_FourOne::getMajorMinor()
  
  ```
  
  The ConfigLog file and the PHP error logs don't show this error, and the ConfigLog files don't seem to show anything related to any database upgrade script. Also, the civicrm\_domain table still shows 5.25.0 in the version column, so I don't think the update script has run at all.
  
  I have no idea why this upgrade would be calling a 4.1 incremental upgrade script? And I'm not sure what steps to take next to recover -- or if I just roll back to my backup. However, I will eventually need to get this upgraded!
  
  Suggestions appreciated!
  
  UPDATE: call stack as requested...
  
  ```
  0 Call to undefined method CRM_Upgrade_Incremental_php_FourOne::getMajorMinor()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:125 
  1   ()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:125
  2   CRM_Upgrade_Form::incrementalPhpObjectVersions()    JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:324
  3   CRM_Upgrade_Form->getRevisionSequence()     JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:845
  4   CRM_Upgrade_Form->setPreUpgradeMessage()    JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php:108
  5   CRM_Upgrade_Page_Upgrade->runIntro()    JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php:57
  6   CRM_Upgrade_Page_Upgrade->run()     JROOT/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:313
  7   CRM_Core_Invoke::runItem()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:69
  8   CRM_Core_Invoke::_invoke()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:36
  9   CRM_Core_Invoke::invoke()   JROOT/administrator/components/com_civicrm/civicrm.php:121
  10  civicrm_invoke()    JROOT/administrator/components/com_civicrm/civicrm.php:40
  11  require_once()  JROOT/libraries/src/Component/ComponentHelper.php:402
  12  Joomla\CMS\Component\ComponentHelper::executeComponent()    JROOT/libraries/src/Component/ComponentHelper.php:377
  13  Joomla\CMS\Component\ComponentHelper::renderComponent()     JROOT/libraries/src/Application/AdministratorApplication.php:101
  14  Joomla\CMS\Application\AdministratorApplication->dispatch()     JROOT/libraries/src/Application/AdministratorApplication.php:159
  15  Joomla\CMS\Application\AdministratorApplication->doExecute()    JROOT/libraries/src/Application/CMSApplication.php:203
  16  Joomla\CMS\Application\CMSApplication->execute()    JROOT/administrator/index.php:51 
  
  ```
  
  **Tags:** joomla, upgrade, database, failure
  
  > **Comments:**
  > **username_1**: Strange!  Can you add the rest of the stacktrace.  That might give a few more clues.  
  > **username_0**: well username_1, I need to figure out how to find it. That's the entire message as shown in the Joomla interface, and I don't see anything similar in ConfigLog or the PHP error log.  I'll try to generate it again.  
  > **username_0**: ok, added. hope that helps -- looks like it's the PHP Incremental versions it's hanging on, not the Civi....but this system is running on PHP 7.4 and has been for quite a while?  
  > **username_2**: Wondering did you delete and completely replace the `administrator/components/com_civicrm/civicrm` with the new files? For all the CMS's except Joomla you need to do that to avoid problems like this, but one thing I don't understand about joomla is that the civi upgrade instructions don't tell you to do that. I would try completely replacing the civicrm folder with the new files (make a backup in case you have something custom in there - you shouldn't but sometimes people do).  
  > **username_0**: I did not, but via username_1's suggestion on Mattermost I tried again and did just that: backed up the code base, uninstalled Civi, and reinstalled . I ran into a couple hiccups (had to manually put back my civicrm.settings.php files, and this one https://civicrm.stackexchange.com/questions/39185/crash-in-upgrade-to-5-35-1-on-task-core-issue365-add-created-date-to-civicrm) but everything seemed to update smoothly. However, now it seems the Joomla permissions are borked.  Am researching now and may open another question.  
  > **username_0**: Just found this as a known issue: https://lab.civicrm.org/dev/core/-/issues/2601 and resolved in 5.37.1 (https://github.com/civicrm/civicrm-core/blob/5.37/release-notes/5.37.1.md).  Will update to 5.37.1 and see if that solves the problem.  
  > **username_0**: OK upgrading to 5.37.1 went smoothly, and I again have access to the Joomla CiviCRM permissions. However, it seems some of my base permissions have been deleted so I'll need to reset them.  But at least the upgrade is done!  
  
  ---
  
  ## 7 answers
  
  ### Answer by username_1 on 2021-05-12. Score: 6 | Accepted answer
  
  After some chat on MM we identified that the installation had a file `CRM/Upgrade/Incremental/FourOne.php` That file has been removed from the current release but the usual Joomla upgrade process extracts the CiviCRM zip file into the existing code directories rather than removing them first. This is fine for new and changed files but does not delete files no longer in the released code.
  
  The [Joomla upgrade documentation](https://docs.civicrm.org/sysadmin/en/latest/upgrade/joomla/#install-the-extension) notes that sometimes it is necessary to uninstall and reinstall. This removes all the old files before installing the new ones. This should not affect the database but note @username_0's comment above that permissions needed to be reset afterwards. (It would be useful if someone could verify what happens to permissions and add a note to the documentation accordingly.)
  
  Alternatively for those with filesystem access the `administrator/components/com_civicrm/civicrm` can be deleted and the installation zip file manually extracted to put the new files in place. (See @username_2's comment above.)
  
  > **Comments:**
  > **username_3**: This works perfectly.  Thanks!  
  > **username_4**: As per username_5's answer below (which builds on this answer), removing the old Three---- and Four---- files from civicrm/CRM/Upgrade/Incremental/php/ solves the problem without a complete Civi uninstall/reinstall. Possibly just removing FourOne.php will do the trick.  
  
  ---
  
  ### Answer by username_5 on 2021-05-27. Score: 5
  
  We also experienced the same problem when upgrading from 5.36.1 to 5.37.2.
  
  Inspired by [the answer from username_1](https://civicrm.stackexchange.com/a/39546/354) I went and looked in `civicrm/CRM/Upgrade/Incremental/php/` and found a few files with old dates and named `Three????.php` and `Four????.php`.
  
  As I was protected by a smoking fresh total Akeeba backup (running on Joomla) I ventured to just move those files to a safe place and retry the update.
  
  And it worked!
  
  > **Comments:**
  > **username_6**: This worked perfectly for me as well, thanks.  
  > **username_4**: Confirm that removing the old Three---- and Four---- files solves the problem without a complete Civi uninstall/reinstall. Possibly just removing FourOne.php will do the trick.  
  
  ---
  
  ### Answer by username_7 on 2021-05-13. Score: 2
  
  I was having exactly the same error on a site that I had not upgraded for a long time. I do have access to the filesystem.
  
  I followed your instructions and I deleted the folder administrator/components/com\_civicrm/civicrm and I extracted the administrator/components/com\_civicrm/civicrm.zip file. This created a new administrator/components/com\_civicrm/civicrm folder.
  
  I then rerun the Upgrade Database with <https://domainname.com/administrator/index.php?option=com_civicrm&task=civicrm/upgrade&reset=1>
  
  and this time I was able to start the upgrade process.
  
  Unfortunately in the middle of the upgrade I got the following error:
  
  [Error: Update smart groups to rename filters on case\_from and case\_to to case\_start\_date and case\_end\_date]
  
  CiviCRM\_API3\_Exception: "DB Error: no such field"
  
  #0 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Upgrade/Incremental/SmartGroups.php(206): civicrm\_api3("SavedSearch", "create", (Array:3))
  #1 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Upgrade/Incremental/SmartGroups.php(27): CRM\_Upgrade\_Incremental\_SmartGroups->renameField("event\_start\_date\_low", "event\_low")
  #2 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Upgrade/Incremental/Base.php(273): CRM\_Upgrade\_Incremental\_SmartGroups->updateGroups((Array:1))
  #3 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Queue/Task.php(74): CRM\_Upgrade\_Incremental\_Base::updateSmartGroups(Object(CRM\_Queue\_TaskContext), (Array:1))
  #4 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Queue/Runner.php(201): CRM\_Queue\_Task->run(Object(CRM\_Queue\_TaskContext))
  #5 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Queue/Page/AJAX.php(36): CRM\_Queue\_Runner->runNext(TRUE)
  #6 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Queue/ErrorPolicy.php(89): CRM\_Queue\_Page\_AJAX::{closure}()
  #7 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Queue/Page/AJAX.php(38): CRM\_Queue\_ErrorPolicy->call(Object(Closure))
  #8 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Core/Invoke.php(279): CRM\_Queue\_Page\_AJAX::runNext()
  #9 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Core/Invoke.php(69): CRM\_Core\_Invoke::runItem((Array:13))
  #10 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Core/Invoke.php(36): CRM\_Core\_Invoke::\_invoke((Array:5))
  #11 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm.php(121): CRM\_Core\_Invoke::invoke((Array:5))
  #12 /home/customer/www/domainname.com/public\_html/administrator/components/com\_civicrm/civicrm.php(40): civicrm\_invoke()
  #13 /home/customer/www/domainname.com/public\_html/libraries/src/Component/ComponentHelper.php(402): require\_once("/home/customer/www/domainname.com/public\_html/administrator/compo...")
  #14 /home/customer/www/domainname.com/public\_html/libraries/src/Component/ComponentHelper.php(377): Joomla\CMS\Component\ComponentHelper::executeComponent("/home/customer/www/domainname.com/public\_html/administrator/compo...")
  #15 /home/customer/www/domainname.com/public\_html/libraries/src/Application/AdministratorApplication.php(101): Joomla\CMS\Component\ComponentHelper::renderComponent("com\_civicrm")
  #16 /home/customer/www/domainname.com/public\_html/libraries/src/Application/AdministratorApplication.php(159): Joomla\CMS\Application\AdministratorApplication->dispatch()
  #17 /home/customer/www/domainname.com/public\_html/libraries/src/Application/CMSApplication.php(203): Joomla\CMS\Application\AdministratorApplication->doExecute()
  #18 /home/customer/www/domainname.com/public\_html/administrator/index.php(51): Joomla\CMS\Application\CMSApplication->execute()
  #19 {main}
  
  And if I try running the upgrade database command again, I get this:
  
  Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
  Database check failed - the database looks to have been partially upgraded. You may want to reload the database with the backup and try the upgrade process again.
  
  What do I do now? Doing a quick check, I seem to be able to access my records, but it sounds like I am left with a partially upgraded database!
  
  I would really appreciate some help. Thanks, username_7
  
  
  ---
  
  ### Answer by username_7 on 2021-05-14. Score: 1
  
  Just an update for anyone else finding themselves in this issue. I have been able to complete manually the Database updates following Eileen suggestions in this post.
  
  [What can I do to fix my database that has been partially upgraded?](https://civicrm.stackexchange.com/questions/4147/what-can-i-do-to-fix-my-database-that-has-been-partially-upgraded)
  
  Thanks,
  username_7
  
  
  ---
  
  ### Answer by username_8 on 2021-05-27. Score: 0
  
  I had the same error, upgrading from 5.35.0. (Joomla) to 5.37.2.
  After renaming the /civicrm directory and extracting the civicrm.zip (and the change l10n for translating) I got errors trying to start the application to execute the upgrade-script (I suppose i had to run the upgrade-script not using the application to do that!).
  But after copying the directories PEAR, MAIL and DB and the same files in com\_civicrm\civicrm\packages from the renamed directory to the new version the application worked and the upgrading is done without (shown) errors.
  
  
  ---
  
  ### Answer by username_9 on 2021-05-13. Score: 0
  
  So I went from 5.36.1 to 5.37.2. I received the same db error. The only issue I had was that I had to copy /ext to /com\_civicrm, delete /civicrm then run civicrm.zip again from the directory, then copy /ext back in. Once I did that I could upgrade the database. The only issue for me was reCaptcha was missing files, so I delete the extension and tried to reinstall but it was not available. Curious if they integrated that into core or do I just need to look harder.
  
  > **Comments:**
  > **username_9**: One additional issue cropped up when we deleted the directory, it also deleted and did not reload the reCaptcha directory/files.  So we get the red error screen stating that Class 'CRM_Utils_ReCAPTCHA' not found.  Now I am just waiting for the next issue to pop up due to deleting the civicrm directory.  
  
  ---
  
  ### Answer by username_10 on 2021-08-10. Score: 0
  
  I had the problem while updating 5.38.1. I hoped maybe if I did a new update the problem would be fixed. But while updating, I got the same error again. As @toni56 forwarded, I first backup and deleted the files "FourOne.php, FourTwo.php, FourThree.php and FourFour.php" in the "/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Upgrade/Incremental/php" directory. Then I tried to update with "administrator/?option=com\_civicrm&task=civicrm/upgrade&reset=1" and PROBLEM IS SOLVED. Thank you so much.
  
  
  ---
  
  