UPDATE.txt 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. INTRODUCTION
  2. ------------
  3. This document describes how to update your Drupal site between 8.x.x minor and
  4. patch versions; for example, from 8.1.2 to 8.1.3, or from 8.3.5 to 8.4.0.
  5. To upgrade from a previous major version (for example, Drupal 6 or 7), the
  6. process involves importing site configuration and content from your old site
  7. into a new Drupal 8 site. The tools and process are currently experimental,
  8. rather than being fully supported, so be sure to test in a development
  9. environment. You will need to use the core Migrate Drupal UI module which
  10. provides a user interface for the Migrate and Migrate Drupal modules included
  11. in core. See https://www.drupal.org/upgrade/migrate for details, and
  12. https://www.drupal.org/node/2167633 for known issues.
  13. First steps and definitions:
  14. * If you are upgrading to Drupal version x.y.z, then x is known as the major
  15. version number, y is known as the minor version number, and z is known as
  16. the patch version number. The download file will be named
  17. drupal-x.y.z.tar.gz (or drupal-x.y.z.zip). Previous Drupal versions used
  18. only x.y (MAJOR.MINOR) to designate their versions.
  19. * All directories mentioned in this document are relative to the directory of
  20. your Drupal installation.
  21. * Make a full backup of all files, directories, and your database(s) before
  22. starting, and save it outside your Drupal installation directory.
  23. Instructions may be found at
  24. https://www.drupal.org/upgrade/backing-up-the-db
  25. * It is wise to try an update or upgrade on a test copy of your site before
  26. applying it to your live site. Even minor updates can cause your site's
  27. behavior to change.
  28. * Each new release of Drupal has release notes, which explain the changes made
  29. since the previous version and any special instructions needed to update or
  30. upgrade to the new version. You can find a link to the release notes for the
  31. version you are upgrading or updating to on the Drupal project page
  32. (https://www.drupal.org/project/drupal).
  33. UPDATE PROBLEMS
  34. ----------------
  35. If you encounter errors during this process,
  36. * Note any error messages you see.
  37. * Restore your site to its previous state, using the file and database backups
  38. you created before you started the update process. Do not attempt to do
  39. further updates on a site that had update problems.
  40. * Consult one of the support options listed on https://www.drupal.org/support
  41. More in-depth information on updating and upgrading can be found at
  42. https://www.drupal.org/upgrade
  43. MINOR AND PATCH VERSION UPDATES
  44. -------------------------------
  45. To update from one 8.x.x version of Drupal to any later 8.x.x version, after
  46. following the instructions in the INTRODUCTION section at the top of this file:
  47. 1. Log in as a user with the permission "Administer software updates".
  48. 2. Go to Administration > Configuration > Development > Maintenance mode.
  49. Enable the "Put site into maintenance mode" checkbox and save the
  50. configuration.
  51. 3. Determine if your project is managed by Composer.
  52. On a typical Unix/Linux command line, this can be determined by running the
  53. following command (replace /PATH/TO/composer with the appropriate location
  54. for your system):
  55. /PATH/TO/composer info drupal/core
  56. If this is successful, your project is managed by Composer.
  57. If you don't have Composer installed or access to the command line, you can
  58. check the contents of composer.json. If "drupal/core" is present in the
  59. "require" section of your composer.json file, then the project is managed by
  60. Composer.
  61. If the project is not managed by Composer, follow the steps under "UPDATING
  62. CODE WITHOUT COMPOSER", otherwise go to "UPDATING CODE WITH COMPOSER".
  63. UPDATING CODE WITH COMPOSER
  64. ---------------------------
  65. 1. On a typical Unix/Linux command line, run the following command from the root
  66. directory (replace /PATH/TO/composer with the appropriate location for your
  67. system):
  68. /PATH/TO/composer update
  69. Note, if Composer is not installed you will need to install it in order to
  70. update Drupal.
  71. Note, if you want to only update drupal/core the following command will
  72. probably work:
  73. /PATH/TO/composer update drupal/core symfony/* --with-all-dependencies
  74. 2. Check the release notes for the updated version of Drupal to find out if
  75. there is a change to default.settings.php.
  76. You can find the release notes for your version at
  77. https://www.drupal.org/project/drupal. At bottom of the project page under
  78. "Downloads" use the link for your version of Drupal to view the release
  79. notes. If your version is not listed, use the 'View all releases' link. From
  80. this page you can scroll down or use the filter to find your version and its
  81. release notes.
  82. If there is a change to default.settings.php, follow these steps:
  83. - Locate your settings.php file in the /sites/* directory. (Typically
  84. sites/default.)
  85. - Make a backup copy of your settings.php file, with a different file name.
  86. - Make a copy of the new default.settings.php file, and name the copy
  87. settings.php (overwriting your previous settings.php file).
  88. - Copy the custom and site-specific entries from the backup you made into the
  89. new settings.php file. You will definitely need the lines giving the
  90. database information, and you will also want to copy in any other
  91. customizations you have added.
  92. 3. Determine if there are any modifications to files such as .htaccess or
  93. robots.txt and re-apply them. The Drupal Scaffold composer plugin
  94. (https://github.com/drupal-composer/drupal-scaffold) can help you with
  95. excluding files you'd like to always preserve when updating Drupal.
  96. 4. Go to the "UPLOADING THE CODE" section
  97. UPDATING CODE WITHOUT COMPOSER
  98. ------------------------------
  99. 1. Remove the 'core' and 'vendor' directories. Also remove all of the files
  100. in the top-level directory, except any that you added manually.
  101. If you made modifications to files like .htaccess, composer.json, or
  102. robots.txt you will need to re-apply them from your backup, after the new
  103. files are in place.
  104. This should leave you with the modules, profiles, sites, and themes
  105. directories. These directories should only contain code that you've used to
  106. extend Drupal.
  107. 2. Download the latest Drupal 8.x.x release from https://www.drupal.org/download
  108. to a directory outside of your web root. Extract the archive and copy the
  109. files into your Drupal directory.
  110. Copy all the files, but do not accidentally overwrite your modules, profiles,
  111. sites, or themes directories.
  112. On a typical Unix/Linux command line, use the following commands to download
  113. and extract:
  114. wget https://www.drupal.org/files/projects/drupal-x.y.z.tar.gz
  115. tar -zxvf drupal-x.y.z.tar.gz
  116. This creates a new directory drupal-x.y.z/ containing all Drupal files and
  117. directories. Copy the files into your Drupal installation directory:
  118. cp -R drupal-x.y.z/* drupal-x.y.z/.htaccess /path/to/your/installation
  119. If you do not have command line access to your server, download the archive
  120. from https://www.drupal.org using your web browser and extract it locally.
  121. 3. Check the release notes for the updated version of Drupal to find out if
  122. there is a change to default.settings.php.
  123. You can find the release notes for your updated version at
  124. https://www.drupal.org/project/drupal. At bottom of the project page under
  125. "Downloads" use the link for your updated version of Drupal to view the
  126. release notes. If your updated version is not listed, use the 'View all
  127. releases' link. From this page you can scroll down or use the filter to find
  128. your updated version and its release notes.
  129. If there is a change to default.settings.php, follow these steps:
  130. - Locate your settings.php file in the /sites/* directory. (Typically
  131. sites/default.)
  132. - Make a backup copy of your settings.php file, with a different file name.
  133. - Make a copy of the new default.settings.php file, and name the copy
  134. settings.php (overwriting your previous settings.php file).
  135. - Copy the custom and site-specific entries from the backup you made into the
  136. new settings.php file. You will definitely need the lines giving the
  137. database information, and you will also want to copy in any other
  138. customizations you have added.
  139. 4. Re-apply any modifications to files such as .htaccess or robots.txt.
  140. If you have added requirements in composer.json, it is recommended that you
  141. re-add the requirements using Composer instead of applying the changes by
  142. hand. For example, on a typical Unix/Linux command line, to reinstall the
  143. Address module and its dependencies run (replace /PATH/TO/composer with the
  144. appropriate location for your system):
  145. /PATH/TO/composer require drupal/address
  146. If you do not have command line access to your server, you will need to run
  147. the Composer commands locally before uploading the file system to your
  148. server.
  149. 5. Go to the "UPLOADING THE CODE" section
  150. UPLOADING THE CODE
  151. ------------------
  152. 1. If you updated the code in a different environment from where it is running
  153. you need to upload the files to your web root including the vendor/
  154. directory.
  155. 2. Go to the "UPDATING THE DATABASE" section
  156. UPDATING THE DATABASE
  157. ---------------------
  158. 1. Run update.php by visiting http://www.example.com/update.php (replace
  159. www.example.com with your domain name). This will update the core database
  160. tables.
  161. If you are unable to access update.php do the following:
  162. - Open settings.php with a text editor.
  163. - Find the line that says:
  164. $settings['update_free_access'] = FALSE;
  165. - Change it into:
  166. $settings['update_free_access'] = TRUE;
  167. - Once the update is done, $settings['update_free_access'] must be reverted
  168. to FALSE.
  169. 2. Go to Administration > Reports > Status report. Verify that everything is
  170. working as expected.
  171. 3. Ensure that $settings['update_free_access'] is FALSE in settings.php.
  172. 4. Go to Administration > Configuration > Development > Maintenance mode.
  173. Disable the "Put site into maintenance mode" checkbox and save the
  174. configuration.