upgrade_from_tripal2.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. Upgrade from Tripal v2 to v3
  2. ================================
  3. .. note::
  4. If you are installing Tripal v3 for the first time you can ignore these upgrade instructions.
  5. Step 1: Upgrade Tripal
  6. ----------------------
  7. 1. Please note the following before upgrading:
  8. .. warning::
  9. If you have created custom extension modules for your site please note that deprecated API functions from Tripal v1.x have been removed from Tripal v3. Therefore, use of deprecated API functions in templates or custom modules may cause a "white screen of death" (WSOD). Check the server logs if this occurs to find where deprecated functions may be used.
  10. .. warning::
  11. Remember to perform a full backup prior to any upgrade. It is recommended to test upgrade on a copy or development version of your site prior to performing on the production site.
  12. .. warning::
  13. Upgrade can only be performed using 'drush' command.
  14. .. warning::
  15. If you have made customizations to Chado you may encounter problems during the upgrade. It is not recommended to ever change any of the existing tables of Chado. However, if you have and if you do encounter such issues, please use the Tripal Issue queue to request help: https://github.com/tripal/tripal/issues
  16. If you have custom Drupal fields attached to Tripal nodes then the content in those fields will not automatically be migrated to the new Tripal v3 entities. Bradford Condon has provided some instructions to help migrate these fields after the site has been upgrade. You can find those instructions `here <https://gist.github.com/bradfordcondon/0dddfd015ff6ef1f545364c2ceff1f0b>`_.
  17. 2. Put the site in maintenance mode. Before completing any upgrade you should put your site into "maintenance mode". This ensures that users are isolated from any temporary error messages generated through the process. To put the site in maintenance mode, navigate to **Administration > Configuration > Maintenance Mode** . Then click the **Put site into maintenance mode** checkbox and click **Save Configuration**. Additionally, there is a text area on this page that allows you to customize the message displayed to your users while your site is in maintenance mode.
  18. .. image:: upgrade_from_tripal2.step1-2.png
  19. You can also put your site into "Maintenance mode" using drush be executing the following command:
  20. .. code-block:: bash
  21. drush vset site_offline 1
  22. 3. Disable tripal modules.
  23. Before updating the Tripal codebase, you should disable all Tripal modules. This ensures that Tripal is not actively trying to access files that you are changing, as well as, clears any cached information for these modules. When using drush, disabling the core module will disable all other Tripal modules:
  24. .. code-block:: bash
  25. drush pm-disable tripal_core
  26. 4. The Tripal modules must also be downloaded and updated. To do this, delete the old Tripal v2 modules directories, located in ``sites/all/modules`` from your Drupal root: for example ``/var/www/html/sites/all/modules`` (be sure you have a backup before removing). The following command will retrieve the Tripal 3 version:
  27. .. code-block:: bash
  28. drush pm-download tripal-7.x-3.1
  29. 5. Enable the tripal module
  30. .. code-block:: bash
  31. drush pm-enable tripal
  32. 6. Enable the tripal_chado module
  33. .. code-block:: bash
  34. drush pm-enable tripal_chado
  35. 7. Enable Tripal v2 Legacy modules. Tripal v2 modules are now called 'legacy modules'. these are the modules that were disabled in step #2. For backwards compatibility, you should re-enable these modules:
  36. .. code-block:: bash
  37. drush pm-enable tripal_core, tripal_views, tripal_db, tripal_cv, tripal_analysis, tripal_organism, tripal_feature, tripal_pub, tripal_stock
  38. Be sure to enable any additional modules not included in the example drush command above. The easiest way to ensure you have re-enabled all the modules disabled above is to copy the list drush provided when asking you to confirm disabling tripal_core above.
  39. 8. (Optional but Recommended) Enable the Tripal DS (provides default themeing for Tripal 3.x) and Tripal Web Services.
  40. - Tripal DS: Tripal 3.x provides complete integration with Drupal's Display UI allowing you to re-order fields and customize display using Drupal Extension modules. The Tripal DS module provides Tripal Panes similar to those in Tripal 2.x (except that more then one pane can be open at a time) and groups fields by default to make the display less overwhelming.
  41. - Tripal Web Services: Tripal Web services provide a way for Tripal sites to share data with each other and with their community in a programmatic manner. Your web services will show the same content available through your Tripal site using the RDF Specification.
  42. .. code-block:: bash
  43. drush pm-enable tripal_ds tripal_ws
  44. 9. Tripal Daemon provides automatic job execution and was previously a tripal extension module but is now part of the main Tripal package. If you had Tripal Daemon installed with Tripal 2 and you would like to continue using it follow these instructions. First, disable the module and remove the module directory.
  45. .. code-block:: bash
  46. drush pm-disable tripal_daemon
  47. Next remove the original tripal_daemon module from the sites/all/modules directory of your site. If you have had the Tripal Daemon installed for Tripal 2 then you should have all the necessary prerequisites and you can simply re-enable the module:
  48. .. code-block:: bash
  49. drush pm-enable tripal_daemon
  50. .. note::
  51. Remember to restart the tripal_daemon once you have completed the upgrade.
  52. 10. Return to your Tripal site, and click the link that appears for preparing Chado and launch the job.
  53. .. image:: upgrade_from_tripal2.step1-10.png
  54. .. note::
  55. You may see the message "Please update the database using "drush updatedb" before continuing" You can safely ignore this message and it should disappear after preparing Chado.
  56. 11. Next, navigate to the permissions page at **Administration > People > Permissions** and ensure that all new Tripal permissions are set appropriately for your site roles.
  57. .. note::
  58. Tripal v3 adds a variety of new permissions so please check the permissions carefully.
  59. 12. You can now bring your site out of maitenence mode. This can be done by either reversing the your actions through the interface in #1 or through drush with the following command:
  60. .. code-block:: bash
  61. drush vset site_offline 0
  62. 13. Software Upgrade Complete! At this point your site is running Tripal 3. You currently have all your Tripal 2 pages (known as nodes) living happily inside your upgraded Tripal 3 site. This is known as "legacy mode". The upgrade process was designed to allow you to upgrade to Tripal 3 first and then migrate your "nodes" slowly to the new "entities" as you are able. Migrating from nodes to entities provides greater flexibilty and access to newer Tripal 3 features.
  63. Step 2: Migrate Content
  64. -----------------------
  65. The process allows you to create Tripal 3 content types exposing the same data as your Tripal 2 nodes. Data is not duplicated as it resides in Chado but rather mappings are made between Chado records and your new Tripal 3 entities just as they were made to Tripal 2 nodes. This step will not remove or destroy existing Tripal v2 nodes/pages but will create new Tripal v3 entities/pages. This allows you to keep existing pages while reviewing and customizing the Tripal v3 content types. Site visitors can continue to visit the Tripal v2 pages. Tripal v3 content types may remain private while customization is underway. Once customization is completed a subsequent step will allow you to swap out Tripal v2 pages for the newer Tripal v3 pages. Once this step is complete, you will also be able to expose your data via Tripal 3 Web Services immediately.
  66. 1. Navigate to **Administration > Tripal > Data Storage > Chado** and click on Step 2.
  67. .. image:: upgrade_from_tripal2.step2-1.png
  68. 2. Select an individual content type to migrate from the Tripal v2 Content Type drop-down.
  69. .. image:: upgrade_from_tripal2.step2-2.png
  70. 3. Click the 'Get Tripal v3 Types' button to retrieve a list of Tripal v3 content types to which this Tripal v2 type can be converted. This may take a while depending on the size of your database.
  71. 4. Select the checkbox beside each Tripal v3 type you would like to create. The number of entities/pages that will be created for that content type is shown in brackets beside the name.
  72. 5. Then click the "Migrate [Tripal v2 Type]" button. This will submit a Tripal job to create the requested content. Submit this job manually on the command-line as follows (note we ``cd`` to the project root at ``/var/www/html``: please navigate to wherever your site is installed):
  73. .. code-block:: bash
  74. cd $DRUPAL_HOME
  75. drush trp-run-jobs --user=administrator
  76. 6. Now repeat 1-5 for each content type. Since this step simply creates new Tripal v3 content without touching the existing Tripal v2 content, there really is no reason not to migrate all your content types. Especially since the Tripal v3 content remains private and thus hidden from your users.
  77. Step 3: Use Legacy Templates (optional)
  78. ---------------------------------------
  79. This step is completely optional and not necessarily recommended. It was provided to aid the upgrade process for Tripal sites with lots of customizations who may not have the developers or time to create new Tripal 3 fields to replace their old templates.
  80. All customizations involving re-ordering or re-naming of existing fields can now be done through the Drupal "Manage Fields" Admin interface found under **Administration > Structure > Tripal Content Types > [Type you are interested in] > "manage fields"**. You can also use this interface to switch from Tripal Panes to a long listing of content, fieldsets, tables, tabs, accordions, etc. I suggest playing around with this new interface and looking into Drupal Field Group and/or Display Suite to explore your options for customizing page display through the interface, since this will ease the transition to Drupal 8.
  81. That said, if you decide to stick with your current customized templates, the following instructions will show you how. Keep in mind this is done on a per content type basis allowing you to do use the new interface on less customized content while still relying on your templates for highly customized content.
  82. 1. Navigate to **Administration > Tripal > Data Storage > Migrate** and click on Step 3
  83. .. image:: upgrade_from_tripal2.step3-1.png
  84. 2. Click the checkbox for the Tripal v2 content types you want to keep your old templates for. Unchecked content types will use the new Tripal 3 interface.
  85. 3. Click Save.
  86. Step 4: Delete Tripal v2 Content and Publish Tripal v3 Content
  87. --------------------------------------------------------------
  88. This final step allows you to fully switch to Tripal v3 pages. You can move URLs and titles from Tripal v2 pages to their corresponding Tripal v3 pages. This ensures user bookmarks and external links to your site are not broken. Here you can also unpublish Tripal v2 content types or completely remove them if desired. You can perform these actions in stages such as first moving titles and URLs, then unpublishing Tripal v2 pages and once the migration has been verified you can finally delete the Tripal v2 pages to free space. Deleting the Tripal v2 content will not delete the data in Chado. The page is simply removed from the site.
  89. 1. Navigate to **Administration > Tripal > Data Storage > Migrate** and click on Step 4
  90. .. image:: upgrade_from_tripal2.step4-1.png
  91. 2. Once you have confirmed that you are happy with the Tripal v3 pages for a given content type, check the desired check boxes for that content type.
  92. 3. Then click submit --This step cannot be reversed!
  93. You have now completed the migration process and can safely disable the Tripal v2.x Legacy modules assuming no extension modules still depend on them.
  94. .. note::
  95. If you are a developer of Tripal extension modules, then the Tripal API is completely backwards compatible so any extension modules that do not interact with nodes directly can safely be made Tripal v3.x compatible by changing the module to depend on **tripal** rather then **tripal_core** (can be done in the modules .info file).
  96. Troubleshooting
  97. ---------------
  98. 1. Dealing with ``stack depth limit exceeded`` on Step 4 of the Migration.
  99. When there is a large number of nodes, Drupal's search module fails to update the search_total table and gives the following error:
  100. .. code-block:: bash
  101. Uncaught exception thrown in shutdown function. PDOException: SQLSTATE[54001]: Statement too complex: 7 ERROR: stack depth limit exceeded
  102. HINT: Increase the configuration parameter &amp;quot;max_stack_depth
  103. You can avoid this problem by clearing out the Drupal search tables byu executing the following SQL commands:
  104. .. code-block:: sql
  105. TRUNCATE search_total;
  106. TRUNCATE search_index;
  107. 2. For sites that have upgrading from Drupal 6:
  108. If your site was upgraded from Drupal 6, you'll need to add a new text format with a machine name called 'full_html' as this is the default formatter that Tripal v3 uses. As in Drupal 6, the 'Full HTML' text format has a numeric machine name (usually '2') that was later changed to 'full_html' in Drupal 7.
  109. To do this, go to **Configuration > Text formats** in your administrative menu and click on the 'Add text format' link:
  110. .. image:: upgrade_from_tripal2.troub-1-1.png
  111. Make sure its machine-readable_name is 'full_html' and save the configuration.
  112. .. image:: upgrade_from_tripal2.troub-1-2.png