Answers.Body: <p>based on this <a href="https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#upgrading-extensions" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#upgrading-extensions</a> you are correct that an uninstall will remove any data related to that extension. </p>
  
  <p>That url also has instructions for how to upgrade extensions via the admin GUI. I usually prefer command line solutions but for Civi extensions I always use the GUI.</p>
  
  <p>Extensions can store data in a bunch of different places, but looking at an old copy of the extension I have accessible, in the sql directory in the mosaico extension, the install file creates two tables civicrm_mosaico_msg_template and civicrm_mosaico_template and the uninstall file deletes those tables. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-08T03:15:55.103Z
Answers.LastActivityDate: 2018-02-08T03:15:55.103Z
Answers.UserDisplayName: ericG
Answers.Body: <p>Agreed with first answer. Also, extension data normally stores in civicrm_extension. You can find information 'is_active' 0 or 1 whether it is inactive or active.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-08T17:08:26.920Z
Answers.LastActivityDate: 2018-02-08T17:08:26.920Z
Answers.UserDisplayName: Prakash
Answers.Body: <p>Its a bad idea of upgrading as uninstall and install new version of extension. You can upgrade the extension either one of the following two ways:</p>
  
  <ol>
  <li><p>If the extension is listed under CiviCRM extension page with auto-download as true then under CiviCRM extension page of your site you should be able to see an option for updating the extension(if option not available than make sure you have Resource URL set for extension correctly, CURL, WGET, ZIP extension installed on server).</p></li>
  <li><p>You can also upgrade the extension manually by replacing the extension folder/files and then visit CiviCRM extension page in your site and click on refresh button. If the new extension requires db changes than you will be prompted with an option on top right of the browser to run db upgrade. Run the upgrade and its ready for use.</p></li>
  </ol>
  
  <p>CiviCRM stores extension settings in civicrm_setting and civicrm_managed table. But some extension have their own install code to store data in various table, uninstalling the extension will lead to loss of such data as incase of mosaico extension. It is recommended to follow <a href="https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#upgrading-extensions" rel="noreferrer">upgrade</a> pattern for upgrading any extension.</p>
  
  <p><strong>Note: Always take backup of db and files before performing upgrade.</strong></p>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-08T15:51:57.790Z
Answers.Text: Thank you @Pradeep for explaining in such detail.  I did visit the documentation - but your answer was much more detailed. Your #1 is my standard approach when it comes to upgrading extensions - but the extensions I mentioned are not built into the plugins directory.
  
  Your Answer #2 should be added to the documentation.
Answers.UserDisplayName: themak
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-08T03:57:39.950Z
Answers.LastActivityDate: 2018-02-08T03:57:39.950Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I am looking to upgrade an extension - for now I have been updating extensions by disabling - then uninstalling the old extension - and then installing and enabling the new extension.  While that has worked for the most part, when I was going to upgrade Mosaico, I was worried if by using my typical method - I would lose all the templates I created.  With that being said - is there a better way to upgrade the extension - and if I do what I typically do, will I lose any data?</p>
  
Tags: <civimail><extension><mosaico>
Title: Where is extension data stored?
ThreadText: # Where is extension data stored?
  
  (Asked by: username_0 on 2018-02-07)
  
  I am looking to upgrade an extension - for now I have been updating extensions by disabling - then uninstalling the old extension - and then installing and enabling the new extension. While that has worked for the most part, when I was going to upgrade Mosaico, I was worried if by using my typical method - I would lose all the templates I created. With that being said - is there a better way to upgrade the extension - and if I do what I typically do, will I lose any data?
  
  **Tags:** civimail, extension, mosaico
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2018-02-08. Score: 6 | Accepted answer
  
  Its a bad idea of upgrading as uninstall and install new version of extension. You can upgrade the extension either one of the following two ways:
  
  1. If the extension is listed under CiviCRM extension page with auto-download as true then under CiviCRM extension page of your site you should be able to see an option for updating the extension(if option not available than make sure you have Resource URL set for extension correctly, CURL, WGET, ZIP extension installed on server).
  2. You can also upgrade the extension manually by replacing the extension folder/files and then visit CiviCRM extension page in your site and click on refresh button. If the new extension requires db changes than you will be prompted with an option on top right of the browser to run db upgrade. Run the upgrade and its ready for use.
  
  CiviCRM stores extension settings in civicrm\_setting and civicrm\_managed table. But some extension have their own install code to store data in various table, uninstalling the extension will lead to loss of such data as incase of mosaico extension. It is recommended to follow [upgrade](https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#upgrading-extensions) pattern for upgrading any extension.
  
  **Note: Always take backup of db and files before performing upgrade.**
  
  HTH
  
  Pradeep
  
  > **Comments:**
  > **username_0**: Thank you @Pradeep for explaining in such detail.  I did visit the documentation - but your answer was much more detailed. Your #1 is my standard approach when it comes to upgrading extensions - but the extensions I mentioned are not built into the plugins directory.  Your Answer #2 should be added to the documentation.  
  
  ---
  
  ### Answer by username_1 on 2018-02-08. Score: 1
  
  based on this <https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#upgrading-extensions> you are correct that an uninstall will remove any data related to that extension.
  
  That url also has instructions for how to upgrade extensions via the admin GUI. I usually prefer command line solutions but for Civi extensions I always use the GUI.
  
  Extensions can store data in a bunch of different places, but looking at an old copy of the extension I have accessible, in the sql directory in the mosaico extension, the install file creates two tables civicrm\_mosaico\_msg\_template and civicrm\_mosaico\_template and the uninstall file deletes those tables.
  
  
  ---
  
  ### Answer by username_2 on 2018-02-08. Score: 0
  
  Agreed with first answer. Also, extension data normally stores in civicrm\_extension. You can find information 'is\_active' 0 or 1 whether it is inactive or active.
  
  
  ---
  
  