> [!CAUTION]
> **Caution:** This documentation covers Edge for Private Cloud 4.51.00, which is no longer supported. Google does not provide security patches, bug fixes, or technical support for this version. The current supported version is 4.54.00. See the [Edge for Private Cloud documentation](https://docs.apigee.com/private-cloud/latest/overview) for the current version, or [All versions](https://docs.apigee.com/private-cloud/versions) to compare releases.

> [!NOTE]
> **NOTE:** This upgrade is for your Private Cloud installation of Drupal only. For customers using a cloud deployment of the portal, Apigee will automatically apply all Drupal security updates.

In an Edge for Private Cloud installation of Apigee Developer Services portal (or simply, *the portal*), you might get a
notification that a new version of Drupal is available. A new version can mean a Drupal feature
release, patch, security update, or other type of Drupal update. In the case of a security
update, you want to upgrade your installation of Drupal as soon as possible to ensure that your
site remains secure.

## Upgrade Drupal core

The procedure below describes how to update a Private Cloud installation of Drupal 7.x.y to
another minor version (for example, Drupal 7.54 to 7.59).

Please note the following:

- This procedure only updates your installation of Drupal. It does not update the Apigee
  software that ships as part of the portal. For information on upgrading the Apigee portal
  software, see [Upgrade the portal](https://docs.apigee.com/private-cloud/v4.51.00/portal-upgrading).

  If during a Private Cloud upgrade (for example, from 4.18.05 to 4.19.01), the Apigee update
  utility actually *downgrades* your version of Drupal, you might need to re-run the
  Drupal upgrade utility. For more information, see
  [Re-run the Drupal upgrade](https://docs.apigee.com/private-cloud/v4.51.00/portal-upgrading#rerun).
- You must execute the [Drush](https://www.drush.org) (Drupal Shell) commands from the root directory of the portal site. By default, the portal is installed at:
  - `/opt/apigee/apigee-drupal/wwwroot` (NGINX)
  - `/var/www/html` (Apache)
  The procedure below assumes an NGINX server installation at the default location above.

### Determine your current Drupal version

Before you start the Drupal update, you can determine your current Drupal version by running
the following command from the Drupal installation folder. By default, Drupal is installed in
`/opt/apigee/apigee-drupal/wwwroot`:

```
cd /opt/apigee/apigee-drupal/wwwroot
```

```
drush status | grep 'Drupal version'
```

You should see output in the form:

```
Drupal version          :  7.54
```

If you installed Drupal in a directory other than `/opt/apigee/apigee-drupal/wwwroot`,
make sure to change to that directory before running the `drush` command.

### Update the Drupal version

This section describes how to use Drush commands from a command line to update your Drupal
version. See also [Updating Drupal
Using Drush (Drupal.org)](https://www.drupal.org/node/2550801).

> [!NOTE]
> **NOTE:** If your portal is on a server with no external internet connection, then:
>
> 1. Download the Drupal installation to a server with internet access.
> 2. Copy the `drupal-x.y` directory to your portal server.
> 3. Follow the steps described in the [README.txt](https://www.drupal.org/docs/7/upgrade-to-drupal-7/read-upgradetxt) file in the Drupal documentation.
>
> During the upgrade of Drupal core, the instructions tell you to remove all core files and
> directories. However, **do not** delete the `/profiles/apigee` directory
> because this is where the Apigee Drupal Devportal distribution is located.

**To update your Drupal installation:**

1. Change to the `/opt/apigee/apigee-drupal/wwwroot` directory, or the directory where you installed the portal.
2. Make a full backup of all files, directories, and databases. Save the backup in a location outside of the Drupal installation. For complete instructions, see [Back up the portal](https://docs.apigee.com/private-cloud/v4.51.00/backup-portal).

   If you made modifications to files such as `.htaccess`,
   `robots.txt`, or `defaults.settings.php` (in the `sites`
   directory), you will have to reapply the changes after the update. You will also need to
   reapply any customizations made in the `sites/all` directory.
3. Put your site into maintenance mode:

   ```
   drush vset --exact maintenance_mode 1
   ```

   ```
   drush cache-clear all
   ```
4. Install the desired version of Drupal by using the following command:

   ```
   drush pm-update drupal-version
   ```

   Where <var translate="no">version</var> is the desired version.

   Alternatively, you can run `drush pm-update drupal` to update to the latest
   Drupal core version. You can run `drush pm-updatestatus` to list available
   minor updates to Drupal core and contrib projects.
5. Reapply any changes made to `.htaccess`, `robots.txt`, or `defaults.settings.php` (in the `sites` directory).
6. Reapply any changes made to the `sites/all `directory.
7. Take your site out of maintenance mode:   

   ```
   drush vset --exact maintenance_mode 0
   ```

   ```
   drush cache-clear all
   ```

## Upgrade PHP and Drupal contrib modules

When you upgrade Drupal using the above instructions in this section, modules used by Drupal
such as contrib and PHP are also upgraded. However, you should keep up with the latest Drupal
modules in between Private Cloud releases.

> [!IMPORTANT]
> **TIP:** To be notified about Drupal security releases, subscribe to [Drupal security
> announcements](https://www.drupal.org/security/psa).

Note that if the module is in `/profiles/apigee/modules/contrib`, you can replace
it with a newer version of that module by storing the newer version in
`/sites/all/modules/contrib`. Edge for Private Cloud uses the newer version in
`/sites/all/modules/contrib` rather than the older version in
`/profiles/apigee/modules/contrib`. For more information, see
[Updating
modules (Drupal.org)](https://www.drupal.org/docs/7/update/updating-modules).

If you install a new Private Cloud version that includes a more recent version of the module
previously stored in `/sites/all/modules/contrib`, remove the module from
`/sites/all/modules/contrib`. For more information, see
[Moving
modules and themes (Drupal.org)](https://www.drupal.org/docs/7/extend/moving-modules-and-themes).

## What if I encounter an issue during the
update?

Restore your site to its previous state using the backup files that you created. Contact
[Apigee Edge Support](https://docs.apigee.com/api-platform/troubleshoot/support) and provide any error messages that were reported during the update.