nativeInstallerdrupal

Upgrade Drupal

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

NOTE: The Approach A sections referred to below do not apply to Bitnami native installers. Users of Bitnami native installers should refer only to the Approach B sections.

NOTE: It is advisable to create a backup before starting the update process. If you have important data, create and try to restore a backup to ensure that everything works properly.

Put your site into maintenance mode

  • Log in to the Drupal administration panel.

  • Browse to the “Administration -> Configuration -> Development -> Maintenance mode” section. Enable the “Put site into maintenance mode” checkbox and save the configuration:

Drupal Maintenance mode

Enable the Maintenance mode

  • Disable the maintenance mode when the upgrade is finished.

Drupal 8

Upgrade using Drush

You can update Drupal core with a minor version change using drush a command-line shell and scripting interface for Drupal that is already included in Bitnami Drupal Stack. To upgrade Drupal with drush, follow the steps below depending on your installation type:

Approach A: Bitnami installations using system packages
  • Create a backup of the .htaccess, settings.php and robots.txt files:

      $ cp installdir/drupal/.htaccess /home/bitnami/.htaccess.backup
      $ cp installdir/drupal/sites/default/settings.php /home/bitnami/settings.php.backup
      $ cp installdir/drupal/robots.txt /home/bitnami/robots.txt.backup
    
  • Change your working directory to the Drupal application:

      $ cd installdir/drupal/
    
  • Upgrade the application using drush updating command:

      $ drush pm-update
    
  • In the Drupal administration panel navigate to the “Report -> Status” section to check that your site has been successfully updated.

Drupal Report Status: successful update

You can also check it in the “Report -> Available updates -> Update” section.

Drupal projects are up to date

  • Restore the backup of the .htaccess and robots.txt files:

      $ cp /home/bitnami/.htaccess.backup installdir/drupal/.htaccess
      $ cp /home/bitnami/robots.txt.backup installdir/drupal/robots.txt
    
Approach B: Self-contained Bitnami installations
  • Create a backup of the .htaccess, settings.php and robots.txt files:

      $ cp installdir/apps/drupal/htdocs/.htaccess /home/bitnami/.htaccess.backup
      $ cp installdir/apps/drupal/htdocs/sites/default/settings.php /home/bitnami/settings.php.backup
      $ cp installdir/apps/drupal/htdocs/robots.txt /home/bitnami/robots.txt.backup
    
  • Change your working directory to the Drupal application:

      $ cd installdir/apps/drupal/htdocs/
    
  • Upgrade the application using the drush updating command:

      $ drush pm-update
    
  • In the Drupal administration panel navigate to the “Report -> Status” section to check that your site has been successfully updated.

Drupal Report Status: successful update

You can also check it in the “Report -> Available updates -> Update” section.

Drupal projects are up to date

  • Restore the backup of the .htaccess and robots.txt files:

      $ cp /home/bitnami/.htaccess.backup installdir/apps/drupal/htdocs/.htaccess
      $ cp /home/bitnami/robots.txt.backup installdir/apps/drupal/htdocs/robots.txt
    

Drupal 7

Upgrade using Drush

You can upgrade the application only without modifying any other stack components. Starting with Drupal v7.12-3, the Bitnami Drupal Stack ships drush, a command-line shell and scripting interface for Drupal. To upgrade Drupal with drush, use the following commands:

  • Change to the application directory depending on your installation type:

    • Approach A (Bitnami installations using system packages):

        $ cd installdir/drupal/
      
    • Approach B (Self-contained Bitnami installations):

        $ cd installdir/apps/drupal/htdocs/
      
  • Execute Drush:

      $ drush up
    

More information is available on the Drush website.

Upgrade using built-in tools

To upgrade Drupal without drush, use Drupal’s built-in mechanism for upgrades by following the steps below:

  • Log in to the Drupal administration panel.

  • Browse to the “Administration -> Configuration -> Development -> Maintenance mode” section. Enable the “Put site into maintenance mode” checkbox and save the configuration.

  • At the server console, download the new Drupal version:

      $ wget http://ftp.drupal.org/files/projects/drupal-X.Y.tar.gz
      $ tar -xzvf drupal-X.Y.tar.gz
    
  • Create a backup of the .htaccess and settings.php files and overwrite the old Drupal installation with the new files. Depending on your installation type, run the following commands:

    • Approach A (Bitnami installations using system packages):

        $ cp installdir/drupal/.htaccess /home/bitnami/.htaccess.backup
        $ cp installdir/drupal/sites/default/settings.php /home/bitnami/settings.php.backup
        $ sudo cp -R drupal-X.Y/* installdir/drupal/
      
    • Approach B (Self-contained Bitnami installations):

        $ cp installdir/apps/drupal/htdocs/.htaccess /home/bitnami/.htaccess.backup
        $ cp installdir/apps/drupal/htdocs/sites/default/settings.php /home/bitnami/settings.php.backup
        $ sudo cp -R drupal-X.Y/* installdir/apps/drupal/htdocs/
      
  • In case your older installation used custom .htaccess or settings.php files, restore them from backup.

  • In the Drupal administration panel, browse to the “Report -> Status” section and run the database update script if necessary.

    Drupal upgrade

Last modification June 16, 2021