Information for: DEVELOPERS   PARTNERS

Updating Lightning

Lightning has a two-pronged update process. When initially installed, Lightning includes a useful, near-complete default configuration for your website, but after installation, your website owns all configuration. Since your website owns the configuration after installation, Lightning cannot change your website without potentially changing its behavior, or, in a worst-case scenario, causing data loss.

As Lightning evolves, the default configuration can change, and in certain limited cases, Lightning attempts to update configuration it depends on. The configuration will typically protect itself to prevent you from modifying it. Otherwise, Lightning will not change your configuration, respecting your website’s ownership of the configuration.

The described group of behaviors requires you use the following process to update your Lightning installation.

Note

You can apply critical security updates without waiting for the Lightning distribution update. Acquia attempts to update the distribution as fast as possible after any security updates.

Before you begin

Depending on the modules or libraries packaged with a Lightning release, specific versions of Lightning may require more configuration or upgrade steps. Before starting a version upgrade, see the Configuration updates section of the Lightning update instructions on GitHub to determine if your version requires the needed steps.

You must follow any other update instructions specific to your version of Lightning when upgrading your files and database.

Procedure

If you installed Lightning using the Composer-based project template, and after addressing any added requirements, complete the following steps to update your codebase’s installed version of Lightning:

  1. From a command-prompt window, navigate to your project: cd [/path/to/YOUR_PROJECT].

  2. Run the following commands to update your codebase’s modules and libraries.

    Ensure you replace [LIGHTNING.VERSION.NUMBER] with your version of Lightning:

    composer self-update
    composer require acquia/lightning:~[LIGHTNING.VERSION.NUMBER] --no-update
    composer update
    
  3. Perform any needed database updates, if required, depending on the version you are updating from, by using one of the following methods:

    • Drupal user interface – Visit http://mysite.com/update.php (where mysite.com is the URL for your website) and follow the on-screen instructions.

    • Drush – Update your database manually from a command-prompt window by using the following steps:

      1. Clear and rebuild caches by running the following command:

        drush cache:rebuild
        
      2. Perform any needed database updates by running the following command:

        drush updatedb
        
  4. Perform any needed Lightning configuration updates, if required, depending on the version you are updating from, by running the following commands:

    drush cache:rebuild
    drush update:lightning
    

For manual update instructions, see the UPDATE.md file packaged with Lightning.

Note

The drush update:lightning command performs all update steps outlined in the manual update instructions. Acquia recommends using the manual update process if the automated command will negatively impact your website configuration.