Answers.Body: <p>It's not completely clear the whole history of what happened to the instance, but it appears that you managed to run the upgrade script twice, and it choked the second time because the fields had already been inserted on the first run of the upgrade.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-16T21:26:25.363Z
Answers.LastActivityDate: 2017-03-16T21:26:25.363Z
Answers.UserDisplayName: Joe Murray
Body: <blockquote>
    <p>Notice: Undefined variable: alreadyInstalled in
    /var/www/vhosts/casem-acmse.org/subdomains/test/httpdocs/wp-content/plugins/civicrm/civicrm/install/index.php
    on line 274</p>
  </blockquote>
  
  <p>Luckily this was on my sandbox site. I forgot that I was no longer logged in and tried to run:</p>
  
  <blockquote>
    <p><a href="http://mysite/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/upgrade&amp;reset=1" rel="nofollow noreferrer">http://mysite/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/upgrade&amp;reset=1</a></p>
  </blockquote>
  
  <p>Now it wants to reinstall CiviCRM. </p>
  
  <p><strong>May I suggest that someone fix this before it happens on a live site.</strong></p>
  
  <p><strong>Update 1:</strong> Looks like I forgot to copy back the civicrm.settings.php file. After changing the version in civicrm_domain back to 4.7.16, I ran it again and it died in 4.17.17.mysql.tpl trying to add the card_type.</p>
  
  <p>ALTER TABLE <code>civicrm_financial_trxn</code>
    ADD card_type INT( 10 ) UNSIGNED NULL DEFAULT NULL COMMENT 'FK to accept_creditcard option group values' AFTER payment_instrument_id,
    ADD pan_truncation INT UNSIGNED NULL COMMENT 'Last 4 digits of credit card.' AFTER check_number;</p>
  
  <p>After adding the card+type manually with no errors, Civicrm refuses to continue.</p>
  
  <p><strong>A copy of civicrm.settings.php could reside in ../uploads/civicrm. Then part one of the upgrade process would be to copy this file and stick in ../uploads/civicrm then copy it back as part one of the install if it exists?</strong></p>
  
  <p>Either that or dump the information in the wp_options table in WordPress and either reload them each time or recreate the file as part of the upgrade.</p>
  
  <p>Given that I'm not emotionally attached to this sandbox database I'm going to get another one</p>
  
Tags: <wordpress><upgrade><4.7>
Title: Error on upgrade 4.7.17
ThreadText: # Error on upgrade 4.7.17
  
  (Asked by: username_0 on 2017-03-16)
  
  > Notice: Undefined variable: alreadyInstalled in
  > /var/www/vhosts/casem-acmse.org/subdomains/test/httpdocs/wp-content/plugins/civicrm/civicrm/install/index.php
  > on line 274
  
  Luckily this was on my sandbox site. I forgot that I was no longer logged in and tried to run:
  
  > <http://mysite/wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1>
  
  Now it wants to reinstall CiviCRM.
  
  **May I suggest that someone fix this before it happens on a live site.**
  
  **Update 1:** Looks like I forgot to copy back the civicrm.settings.php file. After changing the version in civicrm\_domain back to 4.7.16, I ran it again and it died in 4.17.17.mysql.tpl trying to add the card\_type.
  
  ALTER TABLE `civicrm_financial_trxn`
  ADD card\_type INT( 10 ) UNSIGNED NULL DEFAULT NULL COMMENT 'FK to accept\_creditcard option group values' AFTER payment\_instrument\_id,
  ADD pan\_truncation INT UNSIGNED NULL COMMENT 'Last 4 digits of credit card.' AFTER check\_number;
  
  After adding the card+type manually with no errors, Civicrm refuses to continue.
  
  **A copy of civicrm.settings.php could reside in ../uploads/civicrm. Then part one of the upgrade process would be to copy this file and stick in ../uploads/civicrm then copy it back as part one of the install if it exists?**
  
  Either that or dump the information in the wp\_options table in WordPress and either reload them each time or recreate the file as part of the upgrade.
  
  Given that I'm not emotionally attached to this sandbox database I'm going to get another one
  
  **Tags:** wordpress, upgrade, 4.7
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-03-16. Score: 2
  
  It's not completely clear the whole history of what happened to the instance, but it appears that you managed to run the upgrade script twice, and it choked the second time because the fields had already been inserted on the first run of the upgrade.
  
  
  ---
  
  