Skip To Content

Upgrade geodatabases in PostgreSQL on Amazon Web Services

Upgrade your geodatabases to take advantage of new functionality and improvements implemented in the geodatabase. To upgrade an enterprise geodatabase in PostgreSQL on Amazon Web Services (AWS), do one of the following:

The following sections describe methods for getting your geodatabase to the latest possible state.

Update the ArcGIS software on your existing AWS instance and upgrade the geodatabase

You can upgrade ArcGIS Server on your existing instance, upgrade your geodatabase in PostgreSQL, and continue using your existing data and services. Be aware, though, that this means the operating system and all other software on the instance remain at the version they were when you created your instance. For example, if you created your instance from an ArcGIS Server 10.2.2 for AWS AMI, you will continue to use a PostgreSQL 9.2.4 database on an Ubuntu 12.04 operating system. Depending on the version of ArcGIS Server you upgrade to, that version of PostgreSQL may not be compatible.

If the existing PostgreSQL version on your instance is not compatible with the new version of ArcGIS Server, you need to also upgrade PostgreSQL to a supported version. For example, if you launched an ArcGIS 10.8 instance and want to upgrade to ArcGIS Server 11.0 on that instance, you must also upgrade PostgreSQL to a supported version. See the PostgreSQL documentation for information on upgrading PostgreSQL.

How you upgrade ArcGIS Server on AWS depends on how you created the ArcGIS Server site. See ArcGIS upgrades on Amazon Web Services for information on how to upgrade ArcGIS Server on AWS. After you upgrade ArcGIS Server, follow the instructions to upgrade the geodatabase in Amazon RDS for PostgreSQL.

If you used ArcGIS Server Cloud Builder on Amazon Web Services 10.6.1 or an earlier release to create the ArcGIS Server site and geodatabases, see the instructions appropriate to the PostgreSQL location: either on the SITEHOST instance or EGDBHOST instance.

Upgrade geodatabases in Amazon RDS for PostgreSQL

After you upgrade your ArcGIS Server site on AWS, follow these steps to upgrade geodatabases in Amazon RDS for PostgreSQL.

  1. Be sure you have a current, reliable backup of your database in Amazon RDS for PostgreSQL.
  2. Connect to Amazon RDS for PostgreSQL and confirm that the sde user has the privileges required to upgrade.
  3. Log in to one of your ArcGIS Server instances on AWS as the arcgis user.
  4. Open a text editor to create a Python script to upgrade your geodatabase.

    For example:

    vi upgrade.py

  5. Copy the following script into a text editor.

    Alter the script to use information specific to your site, including the instance name, sde password, connection file name and location, and database name.

    #Import arcpy module
    import arcpy
    
    # Create connection file
    arcpy.CreateDatabaseConnection_management("/tmp","egdbrds_connection.sde","POSTGRESQL","my_db_instance_identifier.awsregion_id.rds.amazonaws.com","DATABASE_AUTH", "sde", "E$ri3774", "SAVE_USERNAME", "egdb")
    # Upgrade geodatabase
    arcpy.UpgradeGDB_management("/tmp/egdbrds_connection.sde", "PREREQUISITE_CHECK", "UPGRADE")

    See Create Database Connection and Upgrade Geodatabase for more information on tool syntax.

  6. Save the file and close the text editor.
  7. Use stopserver.sh to stop ArcGIS Server.
  8. Run the script in Python.

    /arcgis/server/tools/python <path to the file>/upgrade.py

    If the upgrade fails, information is written to the GDBUpgrade.log in /arcgis/server/framework/runtime/.wine/drive_c/users/arcgis/LocalAppData/ESRI/Server<#>.

  9. To be sure your geodatabase is upgraded, open a Python command window and run the following, replacing /tmp/egdbrds_connection.sde with your connection file location and name.

    First, open an arcpy prompt.

    cd /arcgis/server/tools
    ./python

    Use isCurrent to determine if the geodatabase is upgraded to the current release.

    import arcpy
    
    isCurrent = arcpy.Describe('/tmp/egdbrds_connection.sde').currentRelease
    
    print isCurrent

    If print isCurrent returns True, your geodatabase is upgraded.

  10. To exit the arcpy prompt, type quit().
  11. Alter the upgrade.py script and run it again for each geodatabase you need to upgrade.

Upgrade geodatabases on SITEHOST

If you created your ArcGIS Server site and geodatabases using ArcGIS Server Cloud Builder on Amazon Web Services, follow the steps in this section to upgrade geodatabases in a PostgreSQL database cluster that reside on the same instance as the ArcGIS Server SITEHOST.

Note:
You cannot directly upgrade ArcGIS Server 10.6.1 and earlier to 11.0. You must upgrade to an intermediate version first and then upgrade to 11.0.

Update ArcGIS Server, move the new st_geometry.so file to the PostgreSQL lib directory, stop ArcGIS Server, run a Python script to upgrade each geodatabase, and restart ArcGIS Server.

  1. Install the new version of ArcGIS Server on your AWS instance and upgrade as you would an on-premises ArcGIS Server site.

    See the ArcGIS Server installation guide for upgrade instructions.

  2. Before you upgrade your geodatabases, make backup copies of them. The easiest way to do that is to make a snapshot of the EBS volume that contains your data. See Amazon Web Services documentation for instructions.
  3. Also, before upgrading, you must copy the st_geometry.so file from /arcgis/server/DatabaseSupport/PostgreSQL/Linux64 to /usr/lib/postgresql/<postgresql version>/lib.
    1. The st_geometry.so file is owned by root; therefore, after connecting to the Amazon Web Services SITEHOST instance as ubuntu, switch users to root:
      sudo su -
      Note:

      Be aware that you cannot connect as the arcgis user and switch to the root user.

    2. Before you copy the new file, rename the old one.
      mv /usr/lib/postgresql/<postgresql version>/lib/st_geometry.so /usr/lib/postgresql/<postgresql version>/lib/st_geometryOLD.so
    3. Copy the new st_geometry.so file.
      cp /arcgis/server/DatabaseSupport/PostgreSQL/Linux64/st_geometry.so /usr/lib/postgresql/<postgresql version>/lib
    4. Change permissions on the st_geometry.so file to allow other users to read and execute it.
      chmod 755 /usr/lib/postgresql/<postgresql version>/lib/st_geometry.so
  4. Switch to the arcgis user.
    su - arcgis
  5. Open a text editor to create the upgrade Python script.

    vi upgrade.py

  6. Copy the following script into a text editor.

    Alter the script to use information specific to your site, including the instance name, sde password, connection file name and location, and database name.

    #Import arcpy module
    import arcpy
    
    # Create connection file
    arcpy.CreateDatabaseConnection_management("/tmp","egdb_connection.sde","POSTGRESQL","ec2-123-456-789-100.compute-1.amazonaws.com","DATABASE_AUTH", "sde", "E$ri3774", "SAVE_USERNAME", "egdb")
    # Upgrade geodatabase
    arcpy.UpgradeGDB_management("/tmp/egdb_connection.sde", "PREREQUISITE_CHECK", "UPGRADE")

    See Create Database Connection and Upgrade Geodatabase for more information on tool syntax.

  7. Save the file and close the text editor.
  8. Use stopserver.sh to stop ArcGIS Server.
  9. Run the script in Python.

    /arcgis/server/tools/python <path to the file>/upgrade.py

    You will likely see multiple notices about type references. You can ignore these; they do not indicate the upgrade failed.

    Information is written to the GDBUpgrade.log in /arcgis/server/framework/runtime/.wine/drive_c/users/arcgis/LocalAppData/ESRI/Server<#> if the upgrade does fail.

  10. Run the following in Python to be sure your geodatabase is upgraded. Replace /tmp/egdb_connection.sde with your connection file location and name.

    First, open an arcpy prompt.

    cd /arcgis/server/tools
    ./python

    Use isCurrent to determine if the geodatabase is upgraded to the current release.

    import arcpy
    
    isCurrent = arcpy.Describe('/tmp/egdb_connection.sde').currentRelease
    
    print isCurrent

    If print isCurrent returns True, your geodatabase is upgraded.

  11. To exit the arcpy prompt, type quit().
  12. Alter the script and run it again for each geodatabase you need to upgrade.
  13. If you need to upgrade PostgreSQL to a supported version, create a database backup and proceed with upgrading PostgreSQL. How you upgrade PostgreSQL depends on the PostgreSQL versions you are upgrading from and to. See PostgreSQL documentation for instructions.
  14. Once all geodatabases (and databases, if necessary) are upgraded, use startserver.sh to restart ArcGIS Server.

Upgrade geodatabases on EGDBHOST

If you created your ArcGIS Server site and geodatabases using ArcGIS Server Cloud Builder on Amazon Web Services, follow the steps in this section to upgrade geodatabases in PostgreSQL that are on their own, dedicated AWS instance (EGDBHOST).

Note:
You cannot directly upgrade ArcGIS Server 10.6.1 and earlier to 11.0. You must upgrade to an intermediate version first and then upgrade to 11.0.

Update ArcGIS Server on the SITEHOST, move the new st_geometry.so file from SITEHOST to the PostgreSQL lib directory on EGDBHOST, stop ArcGIS Server, run a Python script from SITEHOST to upgrade each geodatabase, and restart ArcGIS Server.

  1. Install the new version of ArcGIS Server on your AWS instance and upgrade as you would an on-premises ArcGIS Server site.

    See the ArcGIS Server installation guide for upgrade instructions.

  2. Before you upgrade your geodatabases, make backup copies of them. The easiest way to do that is to make a snapshot of the EBS volume that contains your data. See Amazon Web Services documentation for instructions on making a snapshot of an EBS volume.
  3. Also, before upgrading, you must copy the st_geometry.so file from /arcgis/server/DatabaseSupport/PostgreSQL/Linux64 to /usr/lib/postgresql/<postgresql version>/lib.
    1. Before you copy the new file, rename the old one on EGDBHOST. Since the st_geometry.so file is owned by the root user, log in to EGDBHOST as ubuntu and switch to the root user.
      sudo su -
      
      mv /usr/lib/postgresql/<postgresql version>/lib/st_geometry.so /usr/lib/postgresql/<postgresql version>/lib/st_geometryOLD.so
    2. You must move the st_geometry.so file from /arcgis/server/DatabaseSupport/PostgreSQL/Linux64 on SITEHOST to /usr/lib/postgresql/<postgresql version>/lib on EGDBHOST.

      Since the two source and destination directories on the different instances are not accessible by the same user, log in to SITEHOST as the arcgis user and copy the file to the gisdata directory on EGDBHOST.

      cp /arcgis/server/DatabaseSupport/PostgreSQL/Linux64/st_geometry.so /net/EGDBHOST/gisdata/st_geometry.so
    3. Log in to EGDBHOST as ubuntu.
    4. Switch to the root user.
      sudo su -
    5. Copy the st_geometry.so file from gisdata to /usr/lib/postgresql/<postgresql version>/lib.
      cp /gisdata/st_geometry.so /usr/lib/postgresql/<postgresql version>/lib/st_geometry.so
    6. Change permissions on the st_geometry.so file to allow other users to read and execute it.
      chmod 755 /usr/lib/postgresql/<postgresql version>/lib/st_geometry.so
  4. Log in to SITEHOST as the arcgis user.
  5. Open a text editor to create the upgrade Python script.

    For example:

    vi upgrade.py

  6. Copy the following script into a text editor.

    Alter the script to use information specific to your site, including the instance name, sde password, connection file name and location, and database name.

    #Import arcpy module
    import arcpy
    
    # Create connection file
    arcpy.CreateDatabaseConnection_management("/tmp","egdb_connection.sde","POSTGRESQL","ec2-123-456-789-100.compute-1.amazonaws.com","DATABASE_AUTH", "sde", "E$ri3774", "SAVE_USERNAME", "egdb")
    # Upgrade geodatabase
    arcpy.UpgradeGDB_management("/tmp/egdb_connection.sde", "PREREQUISITE_CHECK", "UPGRADE")

    See Create Database Connection and Upgrade Geodatabase for more information on tool syntax.

  7. Save the file and close the text editor.
  8. Use stopserver.sh to stop ArcGIS Server.
  9. Run the script in Python.

    /arcgis/server/tools/python <path to the file>/upgrade.py

    You will likely see several notices about type references. You can ignore those messages.

    If the upgrade fails, information is written to the GDBUpgrade.log in /arcgis/server/framework/runtime/.wine/drive_c/users/arcgis/LocalAppData/ESRI/Server<#>.

  10. To be sure your geodatabase is upgraded, open Python and run the following, replacing /tmp/egdb_connection.sde with your connection file location and name.

    First, open an arcpy prompt.

    cd /arcgis/server/tools
    ./python

    Use isCurrent to determine if the geodatabase is upgraded to the current release.

    import arcpy
    
    isCurrent = arcpy.Describe('/tmp/egdb_connection.sde').currentRelease
    
    print isCurrent

    If print isCurrent returns True, your geodatabase is upgraded.

  11. To exit the arcpy prompt, type quit().
  12. Alter the upgrade.py script and run it again for each geodatabase you need to upgrade.
  13. If you need to upgrade PostgreSQL to a supported version, create a database backup and proceed with upgrading PostgreSQL. How you upgrade PostgreSQL depends on the PostgreSQL versions you are upgrading from and to. See PostgreSQL documentation for instructions.
  14. Once all geodatabases (and databases, if necessary) are upgraded, use startserver.sh to restart ArcGIS Server.

Migrate content to a 11.0 geodatabase in an Amazon database service instance

To be sure you're getting the latest version of PostgreSQL or if you are upgrading from ArcGIS 10 on AWS, do the following: