Answers.Body: <p>Huge thanks to @PradeepNayak for your help! The problem wasn't with the paths in civicrm.settings.php, but that suggestion led us to look at our configuration. Turns out that we had some confusion between a development and staging server, so were, in fact, not updating the right instance. In essence, the version number from the database was right, but it was looking in the wrong place for the files version.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-30T20:42:41.967Z
Answers.LastActivityDate: 2018-03-30T20:42:41.967Z
Answers.UserDisplayName: RiverRunner
Body: <p>I am updating CiviCRM from 4.7.27 to 4.7.31 on WordPress 4.9.4. Other than CiviCRM, everything is up to date.</p>
  
  <p>I've thoroughly Googled the problem, and have tried three times to do the update. But the "Your database has already been upgraded to CiviCRM 4.7.27" problem persists. I've followed the relevant portions of <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Wordpress" rel="nofollow noreferrer">Upgrading CiviCRM for WordPress</a> for current versions of WordPress and CiviCRM.</p>
  
  <p>In particular, in response to problems other people have had, I've:</p>
  
  <ul>
  <li>Completely deleted my /wp-content/plugins/civicrm folder via FTP (<em>I didn't just rename it</em>).</li>
  <li>Downloaded a fresh copy of CiviCRM 4.7.31, unzipped it locally, and uploaded the civicrm folder to /wp-content/plugins. I confirmed that the remote copy of civicrm.php references version 4.7.31 in the header.</li>
  <li>Deleted the files in /wp-content/uploads/civicrm/templates_c.</li>
  <li>Cleared the browser cache (I'm using Chrome).</li>
  <li>Searched the site files for a rogue civicrm plugin directory. There is none.</li>
  </ul>
  
  <p>All of this in addition to all the other relevant steps in the Upgrading wiki article. (We're not using localization files.)</p>
  
  <p>Nothing works, and I continue to be haunted by "Your database has already been upgraded to CiviCRM 4.7.27" when I run the upgrade script.</p>
  
  <p>What could I be missing? What is causing the problem?</p>
  
  <p>Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-30T01:29:21.900Z
Comments.Text: Digging into the upgrade code and database, the civicrm-version.php file has the 'version' element of the array set to '4.7.31'. And the version field of the only row in the civicrm_domain table is currently '4.7.27'. Those appear to be the source values used by the getUpgradeVersions() function to check whether to upgrade. But I'm not seeing how those two values could be the same in order to get the error message that the system is already at version 4.7.27..
Comments.UserDisplayName: RiverRunner
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-30T16:35:39.527Z
Comments.Text: Can you check civicrm.settings.php to get exact path of civicrm folder
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-30T18:33:54.613Z
Comments.Text: Here's the definition of $civicrm_root: `$civicrm_root = '/home/<domain>/<domain>/wp-content/plugins/civicrm/civicrm/';` I think that is correct, and the path to templates_c is as well.
Comments.UserDisplayName: RiverRunner
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-03T19:15:05.240Z
Comments.Text: Is it possible you have a renamed folder with the old codebase in your directories somewhere?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-04T21:27:17.053Z
Comments.Text: @petednz - Thanks, but no. See my answer below.
Comments.UserDisplayName: RiverRunner
Tags: <wordpress><upgrade>
Title: Persistent "Your database has already been upgraded to CiviCRM" Problem
ThreadText: # Persistent "Your database has already been upgraded to CiviCRM" Problem
  
  (Asked by: username_0 on 2018-03-29)
  
  I am updating CiviCRM from 4.7.27 to 4.7.31 on WordPress 4.9.4. Other than CiviCRM, everything is up to date.
  
  I've thoroughly Googled the problem, and have tried three times to do the update. But the "Your database has already been upgraded to CiviCRM 4.7.27" problem persists. I've followed the relevant portions of [Upgrading CiviCRM for WordPress](https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Wordpress) for current versions of WordPress and CiviCRM.
  
  In particular, in response to problems other people have had, I've:
  
  * Completely deleted my /wp-content/plugins/civicrm folder via FTP (*I didn't just rename it*).
  * Downloaded a fresh copy of CiviCRM 4.7.31, unzipped it locally, and uploaded the civicrm folder to /wp-content/plugins. I confirmed that the remote copy of civicrm.php references version 4.7.31 in the header.
  * Deleted the files in /wp-content/uploads/civicrm/templates\_c.
  * Cleared the browser cache (I'm using Chrome).
  * Searched the site files for a rogue civicrm plugin directory. There is none.
  
  All of this in addition to all the other relevant steps in the Upgrading wiki article. (We're not using localization files.)
  
  Nothing works, and I continue to be haunted by "Your database has already been upgraded to CiviCRM 4.7.27" when I run the upgrade script.
  
  What could I be missing? What is causing the problem?
  
  Thanks!
  
  **Tags:** wordpress, upgrade
  
  > **Comments:**
  > **username_0**: Digging into the upgrade code and database, the civicrm-version.php file has the 'version' element of the array set to '4.7.31'. And the version field of the only row in the civicrm_domain table is currently '4.7.27'. Those appear to be the source values used by the getUpgradeVersions() function to check whether to upgrade. But I'm not seeing how those two values could be the same in order to get the error message that the system is already at version 4.7.27..  
  > **username_1**: Can you check civicrm.settings.php to get exact path of civicrm folder  
  > **username_0**: Here's the definition of $civicrm_root: `$civicrm_root = '/home/<domain>/<domain>/wp-content/plugins/civicrm/civicrm/';` I think that is correct, and the path to templates_c is as well.  
  > **username_2**: Is it possible you have a renamed folder with the old codebase in your directories somewhere?  
  > **username_0**: @username_2 - Thanks, but no. See my answer below.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-03-30. Score: 1 | Accepted answer
  
  Huge thanks to @username_1 for your help! The problem wasn't with the paths in civicrm.settings.php, but that suggestion led us to look at our configuration. Turns out that we had some confusion between a development and staging server, so were, in fact, not updating the right instance. In essence, the version number from the database was right, but it was looking in the wrong place for the files version.
  
  
  ---
  
  