> [!CAUTION]
> **Caution:** This documentation covers Edge for Private Cloud 4.17.05, 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.

*Developer Services Portal v. 4.17.05*

This procedure describes how to upgrade an existing Apigee Developer Channel Services
on-premise installation.

> [!NOTE]
> **Note:** All new installations of the portal for 4.17.01 used Postgres as the database and Nginx as the web server. However, an upgrade to 4.17.01 from a previous release of the portal retained the database and Apache web server used in the previous release. That means your current 4.17.1 portal can use any one of the following configurations:
>
> - Nginx/Postgres for all new 4.17.01 installations
> - Apache/MySQL 5.0.15 or later for all 6.x operating systems updated to 4.17.01
> - Apache/MariaDB 5.1.38 or later for all 7.x operating systems updated to 4.17.01
>
> Before you start the update process, you must determine your current configuration and then
> perform the correct update procedure.

> [!NOTE]
> **Note:** This procedure performs a complete upgrade of Drupal and of the Apigee software that ships with the portal. You might want to upgrade just Drupal itself, possibly because a new version of Drupal is available. A new Drupal version can mean a Drupal feature release, patch, security update, or other type of Drupal update. If you only want to perform an upgrade of Drupal, see [Upgrading the
> Drupal version of a Private Cloud installation](https://docs.apigee.com/private-cloud/v4.17.09/upgrading-drupal-version-private-cloud-installation).

## Determining the correct update procedure

The procedure that you use to update the portal is based on your current installation:

- **If your installation uses Apache/MySQL or Apache/MariaDB from a system
  updated to 4.17.01** , then use [Upgrading
  portal using a .tar file](https://docs.apigee.com/private-cloud/v4.17.05/upgrading-developer-services-portal#upgradingportalusingatarfile).
- **If your installation uses Nginx/Postgres from a new 4.17.01
  installation** , then use [Upgrading a portal
  using RPMs](https://docs.apigee.com/private-cloud/v4.17.05/upgrading-developer-services-portal#upgradingaportalusingrpms).

### Determining
your current installation type

If you are unsure about your current installation type, use the following command to determine
it:

- ls /opt  
  If you are using Nginx/Postgres, you will see the following directories: /opt/apigee and /opt/nginx.   

  If you are using Apache/MySQL or Apache/MariaDB, then these directories should not be present.
- /opt/apigee/apigee-service/bin/apigee-all status  
  If you are using Nginx/Postgres, you will see the following output:  

  + apigee-service apigee-drupal-devportal status  
  OK: apigee-drupal-devportal is up and running  
  + apigee-service apigee-lb status  
  apigee-service: apigee-lb: OK  
  + apigee-service apigee-postgresql status  
  apigee-service: apigee-postgresql: OK
- apachectl -S  
  If you are using Apache/MySQL or Apache/MariaDB, then this command should return the web root directory of the portal, in the form:  

  \*:80 192.168.56.102 (/etc/httpd/conf/vhosts/devportal.conf:1)

## Default installation directory

The upgrade process assumes that the Developer Portal was installed at:

- /opt/apigee/apigee-drupal (Nginx)
- /var/www/html (Apache)

If you did not install the portal in the default directory, modify the paths in the procedure
below to use your installation directory.

If you do not know the installation directory, you can determine it as described in [Commonly used Drush commands](https://docs.apigee.com/private-cloud/v4.17.05/commonly-used-drush-commands).

## New
default installation directory after update of Nginx/Postgres from a new 4.17.01
installation

After updating a new installation of 4.17.01 that uses Nginx/Postgres, the root directory
changed from:

```
/opt/apigee/apigee-drupal
```

to:

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

## Supported upgrade versions

This upgrade procedure is supported for the following versions of the portal:

- pantheon-14.02.x
- pantheon-14.03.x
- pantheon-14.04.x
- pantheon-14.07.x
- pantheon-15-01.x
- OPDK-15-04.x
- OPDK-15-07.x
- OPDK-16-01.x
- OPDK-16-05.x
- OPDK-16-09.x
- OPDK-17-01.x

To determine your portal version, open the following URL in a browser:

`http://yourportal.com/buildInfo`

> [!NOTE]
> **Note:** In 4.17.05 this link was removed. To determine the version, open the **Reports \> Status report** menu entry in Drupal. The portal version appears in the table in the row named **Install profile**.

> [!NOTE]
> **Note:** If nothing is displayed or a version other than one listed above is displayed, then you cannot use this upgrade process. For information on upgrading from any other portal version, contact Apigee Support at [http://apigee.com/about/support/portal](https://apigee.com/about/support/portal).

> [!NOTE]
> **Note:** If for some reason you removed the buildInfo file, then you can determine the version from the profiles/apigee/apigee.info file. The default install location is /var/www/html/profiles/apigee/apigee.info, but you might have changed it at install time if you installed the portal in a directory other than /var/www/html. The apigee.info file contains a line in the form below containing the version:
>
> ```
> version = "OPDK-4.16.05"
> ```

## Before you update

For existing installations, if you have modified any code in Drupal core or in any non-custom
modules, your modifications will be overwritten. This includes, among other things, any changes
you may have made to .htaccess.
You should assume that anything outside the /sites directory is owned by Drupal. An
exception to this rule is robots.txt; if this file exists in the web
root, it will be preserved for you.

Before proceeding with the installation, make a backup of your entire Drupal web root
directory. After performing the installation steps described below, you can restore your
customizations from the backup.

## Upgrading portal using a .tar file

1. Backup your Drupal MySQL/MariaDB instance.   
   For more information, see [http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/](https://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/)
   1. **Option 1: Use Drush**   

      The Drush command sql-dump creates a copy of the database. From your Drupal directory, /var/www/html by default, run the command:  
      \> drush sql-dump \> /path/to/backup_dir/database-backup.sql  

      Use drush help sql-dump for more information.
   2. **Option 2: Use MySQLdump**   
      Use the mysqldump command to create a copy of the database:  
      mysqldump -u ***USERNAME*** -p'***PASSWORD***' DATABASENAME \> /path/to/backup_dir/database-backup.sql  

      There should be no space between the -p option and the password. Single quotes around the password are required if the password contains special characters.  

      You set the ***USERNAME*** and ***DATABASENAME*** when you installed the portal. By default, both are devportal.
2. Make a backup of your entire Drupal web root directory. The default install location is /var/www/html, but you might have changed it at install time.
3. Download the Developer Channel Services DeveloperServices_**x.y.z**.tar file from [ftp.apigee.com](https://ftp.apigee.com), where **x.y.z** corresponds to the portal version number. When prompted, enter the credentials you received from Apigee.  

   You can download a file from the link sent to you by Apigee in a browser or by copying it and then adding it to the following cURL command:  
   \> curl -kOL \<paste link here\>  

   **Note** : If your portal is on a server with no external Internet connection, perform this step on a server with access.  

   Go to [Apigee Edge Support](https://docs.apigee.com/api-platform/troubleshoot/support) and select **Login to your Support Portal** to request the Developer Channel Services upgrade .tar file. If you do not have an account on the Support Portal, select **Login to your Support Portal** and then on the sign in page select **In a
   hurry? Raise a support ticket here**.
4. **For an upgrade on a server with an Internet connection:**
   1. Extract the portal upgrade file:  
      \> tar -xvf \<tar file\>  

      This command extract creates a new directory called DeveloperServices-4.x.y.z.
   2. Change to the DeveloperServices-4.x.y.z directory.
   3. Download the latest Drupal version by using the following command:  
      \> drush dl drupal  

      This command creates a directory named drupal-x.y, where x.y corresponds to the current version of Drupal.
   4. Run the networked-update.sh script:  
      \> ./networked-update.sh  

      Depending on file permissions, you might have to use sudo to run this command, or run it as an administrator.
   5. To receive notifications of Drupal updates, ensure that the Drupal Update manager module is enabled. From the Drupal menu, select **Modules** and scroll down to the **Update manager** module. If it is not enabled, enable it.  

      Once enabled, you can see the available updates by using the **Reports \> Available
      Updates** menu item.  

      Use the **Reports \> Available Updates \> Settings** menu item to configure the module to email you when updates are available and to set the frequency for checking for updates.
5. **For an upgrade on a server with no Internet connection:**
   1. On the server where you downloaded the Developer Channel Services DeveloperServices_x.y.z.tar file, extract the portal upgrade file:  
      \> tar -xvf \<tar file\>  

      This command extract creates a new directory called DeveloperServices-4.x.y.z.
   2. Change to the DeveloperServices-4.x.y.z directory.
   3. Run the non-networked-update.sh script:  
      \> ./non-networked-update.sh  

      Depending on file permissions, you might have to use sudo to run this command, or run it as an administrator.   

      This command downloads all the necessary update files and packages them into a single file named devportal-update.tgz and writes the file to a location of your choosing.
   4. Copy devportal-update.tgz to the target server, the one running the portal.  
      **Note** : Do **not** copy the devportal-update.tgz to the web root of the target server.
   5. Untar the devportal-update.tgz file to the current directory:  
      \> tar -xzf /path/to/devportal-update.tgz
   6. Change to the developer-update directory.
   7. Run the following command to install the update:  
      \> ./install-update.sh
   8. Answer the prompts.

The upgrade is now complete.

## Upgrading a portal using RPMs

Use the following procedure to update the portal RPM on a node:

1. Change to the Drupal directory, /opt/apigee/apigee-drupal by default:  
   \> cd /opt/apigee/apigee-drupal
2. Backup your Drupal database instance. The pg_dump command creates a copy of the database:  

   pg_dump --dbname=***devportal*** --host=***192.168.56.101*** --username=***drupaladmin*** --password --format=c \> /tmp/portal.dmp  

   where:
   - dbname specifies the database name as specified by the PG_NAME property in the portal installation configuration file.
   - host specifies the IP address of the portal node.
   - username specifies the Postgres username used by the portal to access the data base as specified by the DRUPAL_PG_USER property in the portal installation configuration file.
   - You are prompted for the Postgres user password as defined by the DRUPAL_PG_PASS property in the portal installation configuration file.

   <br />

   If you later have to restore from the backup, use the command:  
   pg_restore --clean --dbname=devportal --host=localhost --username=apigee \< /tmp/portal.dmp
3. Make a backup of your entire Drupal web root directory. The default install location is /opt/apigee/apigee-drupal, but you might have changed it.  

   If you are unsure of the location of this directory, use the drush status command or the **Configuration \> Media \> File** entry in the Drupal menu to determine the location of the public file system and private file system path (for the next step).
4. Make a backup of the files in /opt/apigee/data/apigee-drupal-devportal/private.
5. Disable SELinux as described in [Install
   the Edge apigee-setup utility](https://docs.apigee.com/private-cloud/v4.17.05/install-edge-apigee-setup-utility).
6. **For an upgrade on a server with an Internet connection:**
   1. Download the Edge 4.17.05 bootstrap_4.17.05.sh file to /tmp/bootstrap_4.17.05.sh:  
      \> curl https://software.apigee.com/bootstrap_4.17.05.sh -o /tmp/bootstrap_4.17.05.sh
   2. Install the Edge 4.17.05 apigee-service utility and dependencies:   
      \> sudo bash /tmp/bootstrap_4.17.05.sh apigeeuser=***uName*** apigeepassword=***pWord***   

      where ***uName:pWord*** are the username and password you received from Apigee. If you omit ***pWord*** , you will be prompted to enter it.  

      By default, the installer checks to see that you have Java 1.8 installed. You can use the "C" option to continue without installing Java.
7. **For an upgrade on a server with no Internet connection:**
   1. Create a local 4.17.05 repo as described in "Create a local Apigee repository" at [Install the Edge apigee-setup
      utility](https://docs.apigee.com/private-cloud/v4.17.05/install-edge-apigee-setup-utility).  
      **Note** : If you already have an existing 4.17.01 repo, you can add the 4.17.05 repo to it as described in "Update a local Apigee repository" at [Install the Edge apigee-setup utility](https://docs.apigee.com/private-cloud/v4.17.05/install-edge-apigee-setup-utility).
   2. **To install apigee-service from a .tar file** :
      1. On the node with the local repo, use the following command to package the local repo into a single .tar file named /opt/apigee/data/apigee-mirror/apigee-4.17.05.tar.gz:  
         \> /opt/apigee/apigee-service/bin/apigee-service apigee-mirror package
      2. Copy the .tar file to the node where you want to update Edge. For example, copy it to the /tmp directory on the new node.
      3. On the new node, untar the file to the /tmp directory:  
         \> tar -xzf apigee-4.17.05.tar.gz  

         This command creates a new directory, named repos, in the directory containing the .tar file. For example /tmp/repos.
      4. Install the Edge apigee-service utility and dependencies from /tmp/repos:   
         \> sudo bash /tmp/repos/bootstrap_4.17.05.sh apigeeprotocol="file://" apigeerepobasepath=/tmp/repos  

         Notice that you include the path to the repos directory in this command.
   3. **To install apigee-service using the Nginx webserver:**
      1. Configure the Nginx web server as described in "Install from the repo using the Nginx webserver" at [Install the Edge
         apigee-setup utility](https://docs.apigee.com/private-cloud/v4.17.05/install-edge-apigee-setup-utility).
      2. On the remote node, download the Edge bootstrap_4.17.05.sh file to /tmp/bootstrap_4.17.05.sh:  
         \> /usr/bin/curl http://***uName:*** ***pWord*** @***remoteRepo***:3939/bootstrap_4.17.05.sh -o /tmp/bootstrap_4.17.05.sh  

         where ***uName:pWord*** are the username and password you set above for the repo, and ***remoteRepo*** is the IP address or DNS name of the repo node.
      3. On the remote node, install the Edge apigee-service utility and dependencies:   
         \> sudo bash /tmp/bootstrap_4.17.05.sh apigeerepohost=***remoteRepo*** :3939 apigeeuser=***uName*** apigeepassword=***pWord*** apigeeprotocol=http://  

         where ***uName:pWord*** are the repo username and password.
8. Use apigee-service to update the apigee-setup utility:  
   \> /opt/apigee/apigee-service/bin/apigee-service apigee-setup update
9. Run the update utility on your node to update the Postgres database:  
   \> /opt/apigee/apigee-setup/bin/update.sh -c ps -f ***configFile***  

   where ***configFile*** is the configuration file that you used to install the Postgres database. The only requirement on the config file is that the configuration file must be accessible or readable by the "apigee" user.
10. Start Postgres:  
    \> /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql start
11. Run the update utility on your node to update the portal:  
    \> /opt/apigee/apigee-setup/bin/update.sh -c dp -f ***configFile***  

    where ***configFile*** is the configuration file that you used to install the portal. The only requirement on the config file is that the configuration file must be accessible or readable by the "apigee" user.

Note that the root directory of after the update is now:

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

The upgrade is now complete.