annotate core/UPDATE.txt @ 19:fa3358dc1485 tip

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