Skip To Content

Tutorial: Perform web editing using replicated data from an enterprise geodatabase

Complexity: AdvancedData Requirement: Use your own data Goal: Create a feature service that allows you to edit replicated data from an enterprise geodatabase over the web using the ArcGIS Online map viewer.

Web-based editing allows a larger group of people to add to and improve on your data. These include field-workers, analysts in other departments of your company, or perhaps even crowdsourced volunteers who may be able to make valuable contributions to your data given a simple editing interface.

In this tutorial, you'll create two enterprise geodatabases for the purposes of managing shoreline bird sightings. One geodatabase will be used for managing the bird sightings on-premises (a local machine), and the other geodatabase will be used for managing bird sightings submitted by volunteers on the web (an enterprise geodatabase residing on the ArcGIS Server machine). When edits are committed to either geodatabase, a geodata service will be used to synchronize the edits between both geodatabases.

The following diagram describes this process in more detail:

Publisher's machine and ArcGIS Server using their own distinct geodatabases

The process of performing web editing is actually the final step of larger workflow. This tutorial demonstrates how to do the following:

  1. Set up enterprise geodatabases using database platforms such as PostgreSQL, SQL Server, or Oracle.

  2. Author a map document that supports web editing. This involves designing the map document to be compliant with the feature service. The feature service allows users to add and edit bird sightings in your enterprise geodatabase over the web. This is a key component to any web editing workflow.

  3. Prepare the data in your local enterprise geodatabase for publishing to ArcGIS Server. This involves connecting to ArcGIS Server, registering your local and web databases with the server, creating a geodata service for synchronizing changes, and sending a replica of the data in your local geodatabase to ArcGIS Server's geodatabase.

  4. Publish your map document as a map service with the Feature Access capability enabled. This creates a feature service endpoint through which clients, such as a web application, can access and edit the bird sightings in your map.

  5. Consume the feature service in a web application. In this tutorial, you'll use the map viewer in ArcGIS Online to quickly edit, update, and delete bird sightings in your map. Additionally, you'll make local edits to your data and synchronize the changes between both geodatabases using ArcMap.

Before beginning this tutorial

If you've just installed ArcGIS Server, consider reading the following before you begin this tutorial:

Set up enterprise geodatabases

Feature services require an enterprise geodatabase. That's because enterprise geodatabases are designed to be edited simultaneously by multiple users, which is the situation you'll encounter in this tutorial. ArcGIS supports a variety of database platforms for enterprise geodatabases, such as PostgreSQL, SQL Server, and Oracle.

For the purposes of this tutorial, you'll need to set up two empty enterprise geodatabases to store the features you create and edit; one database on-premises (preferably on the machine you're going to use to publish) and one database on ArcGIS Server. If you've already installed a supported database platform and have empty geodatabases set up on-premises and on the server, proceed to the next section. If you don't, you'll need to create two new enterprise geodatabases by installing an appropriate database platform on your local machine and on ArcGIS Server. Before doing so, make sure that your operating system and license level of ArcGIS Server and ArcMap support the database platform you want to install.

The following topics describe the installation process for each database platform. They also include links to ancillary topics that describe how to create a new enterprise geodatabase and properly configure it for use within your organization. Once you've installed the appropriate database platform on your local machine and ArcGIS Server and created new geodatabases, proceed to the next section in this tutorial.

Create a new database user

Once you've created empty enterprise geodatabases, you'll need to create a new database user to manage your edits. To do this, you need to connect to your databases, create a new database user on each database, and reconnect to the databases as the new user.

Connect to the database and create a new user

  1. In ArcCatalog or the Catalog window in ArcMap, expand the Database Connections folder Database Connection, and double-click Add Database Connection Add Database Connection.

    The Database Connection dialog box opens.

  2. On the Database Connection dialog box, choose the type of database with which you want to connect from the Database Platform drop-down list.
  3. Enter the appropriate database properties and authentication credentials to connect to the database. If you need help, see Database connections in ArcMap to learn how to enter the correct information to connect to your database.
  4. Click OK. The connection to your database appears in the Database Connections node Database Connection.
  5. Right-click your new database connection, and choose Administration > Add User. This launches the Create Database User geoprocessing tool.
  6. On the Create Database User dialog box, provide a new database user name and database user password, for example, User: editor, Password: tutorial.
  7. Click OK. The new user is created in the database.
  8. Repeat these steps for the other database you're going to use in this tutorial.

Reconnect to the database as the new user

  1. In ArcCatalog or the Catalog window in ArcMap, expand the Database Connection folder Database Connection, and double-click Add Database Connection Add Database Connection.
  2. On the Database Connection dialog box, provide the authentication credentials for the new user you created in the previous section.
  3. Click OK. You are now connected to the database as the new user.
  4. In the Database Connections folder Database Connection, delete the first connection you established to your database. This will help eliminate confusion when specifying your database connection file later in the tutorial.
  5. Repeat these steps for the other database you're going to use in this tutorial.
  6. Rename your connections so that it's easy to distinguish between your local and web enterprise geodatabases. To do this, right-click the connection, and choose Rename.

Author a map document to support feature services and web editing

After you've set up your enterprise geodatabases, you can begin the work of authoring a map document to support the feature service you'll use for web editing.

In this section of the tutorial, you'll do the following:

  • Create an attribute domain to enforce data integrity
  • Create a feature class to represent bird sightings
  • Create feature attachments so users can add external media to their bird sightings
  • Define layer renderer and symbology
  • Add a basemap for context
  • Version the data in the database
  • Add bird sightings to your map

The following steps should only be performed on the local database. Later in the tutorial, you'll use a geodata service to send a replica (copy) of the database items you create below into the database residing on ArcGIS Server. To get started authoring a map document, follow the steps below.

Create an attribute domain

To enforce data integrity when editing, you'll configure an attribute domain to limit the sightings added to your database to a few specific bird types.

  1. Start ArcMap, open a new empty map document, and save the map document. The map document does not have to be saved in a location that is visible to the account running ArcGIS Server.
  2. In the Catalog window, expand the Database Connections folder Database Connection.
  3. Right-click your local database connection, and choose Properties Properties.
  4. On the Database Properties dialog box, click the Domains tab.
  5. In the Domain Name field, click the first cell, and type Type.
  6. In the Description column next to the domain name, click the first cell, and type Bird Type.
  7. In the Domain Properties section, click the cell next to Field Type, and choose Long Integer.
  8. Click the cell next to Domain Type, and choose Coded Values.
  9. In the Coded Values section, click the first cell under Code, and type 0.
  10. In the Description column next to the code, click the first cell, and type Alcid/Pelagic.
  11. Enter the remaining bird types in the Coded Values section from the following table:

    CodeDescription
    1Diving Bird
    2Gull/Tern
    3Raptor
    4Shorebird
    5Wading Bird
    6Waterfowl
    7Unknown
  12. Specifying the domain for the shoreline bird sightings database
  13. Click OK.

Create a feature class

In this section of the tutorial, you'll create a point feature class that will represent the various types of birds in your bird sightings geodatabase. This includes defining the spatial reference of the feature class and assigning your domain to a new field in the feature class table. To get started, follow these steps:

  1. In the Catalog window, right-click your local database connection, and choose New > Feature Class.
  2. On the New Feature Class dialog box, type shoreline_birdsightings in the Name field.
  3. From the Type drop-down list, choose Point Features. Click Next.
  4. In the coordinate system search box, type web mercator (auxiliary sphere), and click Search Search.
  5. In the results list, choose WGS 1984 Web Mercator (auxiliary sphere). This is the same coordinate system used by ArcGIS Online and will allow you to seamlessly overlay your feature service with ArcGIS basemap services. Click Next.
  6. In the XY Tolerance panel, accept the defaults, and click Next.
  7. In the Configuration Keyword panel, accept the defaults, and click Next.
  8. In the Field Properties panel, in the Field Name column, click the cell below SHAPE, and type TYPE.
  9. In the Data Type column, click the cell below Geometry, and choose Long Integer.
  10. Edit the properties of the field by clicking the cell to the right of Domain and choosing Type. This specifies that the field will only accept the values defined in the Type domain you created earlier in the tutorial.
  11. In the Field Name column, click the cell below the TYPE field, and type COMMENTS.
  12. Specify the data type of the COMMENTS field to be Text.
  13. Click Finish.

Your feature class is created and added to the table of contents automatically.

Create feature attachments

In this section, you'll add feature attachments to your feature class. An attachment is a media file, such as an image, PDF, or video, that can be associated with a feature when it's created or edited. For example, when a user adds a shoreline bird sighting to the database, they can attach a photograph of the bird for additional context. When the feature is clicked, the attachment is displayed.

  1. In the Catalog window, expand the connection to your local enterprise geodatabase.
  2. Right-click the shoreline_birdsightings feature class, and choose Manage > Create Attachments.

ArcMap adds a new table to contain the attached files and a relationship class to manage the link between the features and their attachments.

Define layer renderer and symbology

In this section, you'll define a layer renderer and symbology for the various bird types in your database. The way you symbolize your features is important, since features are displayed on the web using the symbology defined in the map document.

  1. In the ArcMap table of contents, click List By Drawing Order List By Drawing Order.
  2. Right-click the shoreline_birdsightings feature class, and click Properties Properties.
  3. On the Layer Properties dialog box, click the Symbology tab.
  4. On the Show dialog box, click Categories > Unique values. This specifies that you'll use a unique value renderer for all the features in your database.
  5. In the Value Field drop-down list, choose TYPE.
  6. Click Add All Values. Each bird type is added to the list.
  7. Uncheck the check box next to the <all other values> symbol.
  8. Double-click the symbol next to the Alcid/Pelagic bird type.
  9. On the Symbol Selector dialog box, type alcid in the search field, and click Search Search.
  10. Select the Alcid/Pelagic Bird symbol, and increase its size to 25.
  11. Click OK. The symbol is applied to the Alcid/Pelagic bird type.
  12. Based on the following criteria, use the symbol search to specify the symbology for the remaining bird types:

    Bird typeSearch criteriaSymbolSize

    Diving Bird

    diving birdDiving Bird25

    Gull/Tern

    ternGull/Tern25

    Raptor

    raptorRaptor25

    Shorebird

    shorebirdShorebird25

    Wading Bird

    wading birdWading Bird25

    Waterfowl

    waterfowlWaterfowl25

    Unknown

    question mark (In the results list, choose the ESRI_Optimized style.)

    Unknown25
  13. When you're finished specifying the symbology, click OK on the Layer Properties dialog box. The symbology appears in the ArcMap table of contents.

Add a basemap for context

For context, you'll add a basemap to your map document from ArcGIS Online.

  1. From the main menu in ArcMap, click File > Add Data > Add Basemap.
  2. Choose Light Gray Canvas as the basemap, and click Add. The basemap is added to your map display.
  3. Zoom in to an area of interest, for example, a familiar coast or shoreline, and save your map document.

Version the feature class in the geodatabase

For the purposes of this tutorial, register the feature class you created in your local database as versioned. Versioning allows multiple users to edit the same data in an enterprise geodatabase without applying locks or duplicating data and aids in geodatabase replication. When you register the feature class as versioned, two delta tables are created in the database to manage inserted, updated, and deleted features. When the edits are synchronized or saved, they are moved from the delta tables to the base table of the default version of the database.

Versioning is an essential workflow in many production environments, and practicing using this method can make you more proficient in managing distributed data. For more information, see A quick tour of versioning.

To register your data as versioned, follow these steps:

  1. In the Catalog window, expand the connection to your local enterprise geodatabase.
  2. Right-click the shoreline_birdsightings feature class, and choose Manage > Register As Versioned.
  3. On the Register As Versioned dialog box, make sure Register the selected objects with the option to move edits to base is not selected. Click OK.
  4. Right-click the shoreline_birdsightings feature class, and choose Manage > Add Global IDs. This creates a column in your feature class that allows the geodatabase replication process to uniquely identify rows across geodatabase versions.
  5. In the Confirm Add GlobalIDs window, click Yes.

Add features to your map

Now that you've symbolized your features appropriately, added a basemap for context, and versioned your feature class, you'll set up the proper editing environment and add features to your map.

  1. In ArcMap, display the Editor toolbar by choosing Customize > Toolbars > Editor from the main menu.
  2. On the Editor toolbar, click Editor > Start Editing. A default feature editing template is created based on the symbology of the editable layers in your map document. You'll use this feature template in the next step to add features to your map.
  3. On the Editor toolbar, click Create Features Create Features.
  4. In the Create Features window, select a bird type, and add it to the map.
  5. On the Editor toolbar, click Attributes Attributes.
  6. In the Attributes window, add a comment and attachment to the feature you created. You can search the web for a picture of the bird you chose, save it as an image, and add it as an attachment.
  7. Adding a bird sighting to the ArcMap display

  8. In the table of contents, right-click the shoreline_birdsightings feature class, and choose Open Attribute Table.
  9. In the Table window, verify that your feature and comments are included in the table. Close the table when you're finished.
  10. Repeat steps 3 through 8 to add another bird sighting to your map.
  11. On the Editor toolbar, click Editor > Stop Editing. When prompted to save your edits, click Yes.
  12. Save your map document.

Prepare your local enterprise geodatabase for publishing

Now that you've created and edited your map document, you're ready to prepare your local enterprise geodatabase for publishing. To do so, you'll need to do the following:

  • Remove the basemap layer.
  • Connect to ArcGIS Server.
  • Register your database with the server and create a geodata service.
  • Send a replica of the local geodatabase to ArcGIS Server's geodatabase using the geodata service.

To get started, follow the steps in the sections below.

Remove the basemap layer

  1. In the ArcMap table of contents, right-click the basemap, and choose Remove.
  2. Save your map document.

Connect to ArcGIS Server

  1. In the Catalog window in ArcMap, expand the GIS Servers node.
  2. Double-click Add ArcGIS Server Add ArcGIS Server.
  3. Choose Publish GIS services, and click Next.
  4. For Server URL, type the URL of the ArcGIS Server site you want to connect to. The default is http://gisserver.domain.com/arcgis. If you or your server administrator installed ArcGIS Web Adaptor, the URL will vary depending on the Web Adaptor configuration. See Components of ArcGIS URLs for additional URL examples.
  5. In the Server Type drop-down list, make sure ArcGIS Server is selected.
  6. For the purposes of this tutorial, accept the default staging folder location.
  7. If your server administrator has enabled security for your site, provide your user name and password. Click Finish.

A publisher connection to ArcGIS Server is created in the GIS Servers node.

Register your database with ArcGIS Server and create a geodata service

Since you'll be publishing a feature service that uses data replicated from a local enterprise geodatabase, you'll need to register both geodatabases with ArcGIS Server. Registration allows ArcGIS Server to connect to your enterprise geodatabases and the data referenced by your map document. This helps you validate that you're ready to publish.

When registering your geodatabases with the server, you'll also select the option to create a geodata service. This service will be used to send a replica of the local geodatabase to ArcGIS Server and to synchronize edits between both geodatabases later in the tutorial.

  1. In the Catalog window, right-click your publisher connection to ArcGIS Server, and select Server Properties.
  2. On the ArcGIS Server Properties dialog box, next to the Registered Databases panel, click Add Add.
  3. On the Register Database dialog box, provide a unique name. This name will be used to register the databases with ArcGIS Server and be used as the geodata service name. For example, type shoreline_bird_sightings.
  4. In the Publisher database connection section, click Import.
  5. On the Browse for a Database Connection dialog box, click the Look in drop-down list, and choose Database Connections.
  6. Select the connection to your local geodatabase, and click Select.
  7. In the Server database connection section of the Register Database dialog box, uncheck the Same as publisher database connection check box. This specifies that the publisher's machine and ArcGIS Server are working with different databases. For more information, see About registering your data with the server.
  8. In the Server database connection section, click Import.
  9. On the Browse for a Database Connection dialog box, click the Look in drop-down list, and choose Database Connections.
  10. Select the connection to ArcGIS Server's geodatabase, and click Select.
  11. In the Server database connection section, make sure the box next to Create geodata service is checked. This specifies that a geodata service will be created for ArcGIS Server's database. This service will be used to send a replica of the local geodatabase to ArcGIS Server and to synchronize edits between both geodatabases later in the tutorial.

    Both connections are imported and the Create geodata service option checked

  12. Click OK. Your enterprise geodatabases are registered with the server and appear on the Registered Databases dialog box.
  13. Click OK to close the ArcGIS Server Properties dialog box.

Send a replica of the local geodatabase to ArcGIS Server

Now that you've registered your databases with the server and created a geodata service, you'll use the geodata service to send a replica of the local geodatabase to ArcGIS Server's geodatabase. The two-way replica you create below will be used to synchronize changes between the local geodatabase and ArcGIS Server's geodatabase.

  1. In ArcMap, display the Distributed Geodatabase toolbar by choosing Customize > Toolbars > Distributed Geodatabase from the main menu.
  2. On the Distributed Geodatabase toolbar, click Create Replica Create Replica.
  3. On the Create Replica Wizard window, select Two way replica. Click Next.
  4. On the next panel, under What do you want to replicate?, make sure that Data is selected.
  5. For Which geodatabase do you want to replicate data to?, select Geodatabase, and click the browse button Browse.
  6. On the Open geodatabase window, click the Look in drop-down list, and choose GIS Servers.
  7. Double-click your publisher connection to ArcGIS Server and select the geodata service you created earlier in the tutorial. Click Open.
  8. For What do you want to call this Replica?, type shoreline_birdsightings_web_replica. Click Next.

    Replica is created using the geodata service

  9. On the last panel, make sure No further action is selected. Click Finish.

    After you click finish, a replica of your local geodatabase is sent to ArcGIS Server's geodatabase. This replica will be used to synchronize changes between both geodatabases. To verify that the replica was created on the server, continue with these steps.

  10. In the Catalog window, expand the Database Connections Database Connection folder, and double-click your connection to ArcGIS Server's geodatabase. You'll see the data and attachments you created earlier in the tutorial appear under the connection.
  11. Right-click your connection to ArcGIS Server's geodatabase, and select Distributed Geodatabase > Manage Replicas Manage Replicas.
  12. In the Replica Manager window, you'll see the two-way replica and its associated properties listed. Review the properties of the replica, and close the Replica Manager window.

Publish a map service with feature access enabled

Now that you've done the work of preparing your databases and creating a geodatabase replica on the server, you can publish your map document with the Feature Access capability enabled. This creates a feature service endpoint to your map service through which clients, such as a web application, can access and edit the features in your map.

Since the data referenced by the map document has already been registered with the server and a replica of this data has been created in ArcGIS Server's geodatabase, the data paths in the map document will automatically be switched to point at the geodatabase replica on the server when you publish. There is no need to do any additional configuration work; the result feature service will automatically be pointed to use the replica in ArcGIS Server's geodatabase.

To publish your map document with the Feature Access capability enabled, follow these steps:

  1. From the main menu in ArcMap, choose File > Share As > Service.
  2. In the Share as Service window, choose Publish a service. Click Next.
  3. In the Publish a Service dialog box, choose the publisher connection to ArcGIS Server you set up earlier in the tutorial.
  4. By default, the name of the map document dictates the service name. Instead of using the default, type Shoreline_BirdSightings. Click Next.
  5. By default, services are published to the root folder (root) of ArcGIS Server. Accept the default location, and click Continue.

    The Service Editor dialog box is displayed. Use the Service Editor to choose what users can do with your feature service and take fine-grained control of how the server will expose your feature service.

  6. Click the Capabilities tab.
  7. By default, mapping and KML are enabled. Choose Feature Access. Enabling this option creates an associated feature service with your map service that allows clients to perform feature editing over the web.
  8. In the left pane of the Service Editor dialog box, click Feature Access, and review the URLs, operations, and properties enabled for your feature service. For the purposes of this tutorial, accept the defaults and continue. To learn more about feature service operations and properties, see Editor permissions for feature services.
  9. In the left pane of the Service Editor dialog box, click Item Description, and type the following summary and tags for your service:

    • Summary: The Shoreline Bird Sightings feature service allows users to add common shoreline bird sightings to a map, attach photographs to sightings, and input comments.
    • Tags: shoreline, bird, sighting

  10. Click Publish Publish.

Your feature service is published to ArcGIS Server. When the publishing process completes, you're ready to consume your shoreline bird sightings feature service in a web application, make edits, and synchronize edits with your local enterprise geodatabase.

Consume the feature service

In this section of the tutorial, you'll use the map viewer in ArcGIS Online to add, update, and edit features in your bird sightings enterprise geodatabase over the web. Lastly, you'll make similar edits to your local geodatabase and use the geodata service to synchronize the changes between both geodatabases.

Edit the feature service over the web

To edit your feature service over the web, you'll use the map viewer in ArcGIS Online. You can deploy the map viewer directly through the ArcGIS Server Services Directory. It does not require any configuration or programming work to get the Map Viewer up and running.

To get started editing your feature service, follow these steps:

  1. Open a web browser, and navigate to the ArcGIS Server Services Directory. Typically, this is located at http://gisserver.domain.com:6080/arcgis/rest/services. You can also access the Services Directory by opening the shortcut installed with ArcGIS Server.
  2. In the services list, click Shoreline_BirdSightings (FeatureServer).
  3. On the Shoreline_BirdSightings (FeatureServer) page, the bird sightings feature class is listed, as well as the feature service's supported operations. Review these parameters, and click View In: ArcGIS Online map viewer. A new window (or tab) opens, displaying the feature service in the map viewer. The Map Viewer display is zoomed to the feature you added to your geodatabase previously in the tutorial.
  4. At the top of the Map Viewer, click Edit. The bird types you symbolized appear within the Add Features dialog box. Take some time to pan and zoom, add features to the map, delete features, modify feature geometry, and add attachments. You can also switch the basemap layer to more appropriately complement your area of interest.

    Adding a bird sighting to the database using the ArcGIS Online map viewer

  5. Verify that edits to your features are reflected in ArcGIS Server's enterprise geodatabase. You can do this by opening the attribute table of ArcGIS Server's bird sightings feature class in ArcCatalog.
  6. Optionally, save the web map.

Edit features in your local geodatabase

  1. In ArcMap, open the map document you used to create the feature service if it's not already open.
  2. On the Editor toolbar, click Editor > Start Editing.
  3. Add a new feature to the map. Optionally, add a comment and attachment to the feature you created.
  4. In the table of contents, right-click the shoreline_birdsightings feature class, and choose Open Attribute Table.
  5. In the Table window, verify that your feature is included in the table. Close the table when you're finished.
  6. On the Editor toolbar, click Editor > Stop Editing. When prompted to save your edits, click Yes.
  7. Save your map document.

Synchronize the edits

The edits you make to your feature service over the web are only applied to ArcGIS Server's geodatabase. Conversely, the edits you make locally are only applied to your local geodatabase. To make these datasets identical again, you need to synchronize the changes between both geodatabases.

Follow the steps below to synchronize the edits:

  1. In ArcMap, on the Editor toolbar, select Synchronize Changes Synchronize Changes.
  2. In the Synchronize Changes Wizard window, specify the Synchronization Direction as Both. Click Next.
  3. On the next panel, accept the defaults, and click Finish.
  4. The edits to both geodatabases are synchronized. It's a good practice to verify that the geodatabases are in sync. To do so, continue with these steps.
  5. In ArcMap, refresh the map display. You'll see that your web edits are now available in the local geodatabase.
  6. Navigate back to the ArcGIS Online map viewer, and refresh your browser. You'll see that your local edits are now available in ArcGIS Server's geodatabase.

Further reading

Now that you've successfully tested your feature service and synchronized the changes between both geodatabases, you might want to consider how you can use this workflow in your organization by reading the following:

Additional ArcGIS web clients

Although this tutorial used the map viewer in ArcGIS Online, you might want to consider how you can use and share your feature service in other ArcGIS clients. For example:

  • Portal for ArcGIS also has a map viewer. You can share your feature service with a portal organization of which you're a member, and allow others to edit the feature service in the map viewer.
  • In ArcGIS Online and Portal for ArcGIS, you can create a customized web mapping application using the application templates. These templates can be deployed on your organization's web server.
  • The ArcGIS API for JavaScript offers the most advanced web mapping capabilities and customization options. If you're comfortable programming using this API, you can create a rich editing experience for your users on the web by utilizing a feature service identical to the one you created in this tutorial.

Keep in mind that web-based editing allows external users to add to and improve on your data. By exploring one or all of the ArcGIS clients listed above, you give yourself additional options that can help you tailor your editing scenario for a specific purpose, goal, or organizational strategy.

Script data synchronization

You can automate the synchronization process by scripting. For example, you can schedule a synchronization while the feature service is running without interrupting availability. For more information, see Synchronize Changes (Data Management).

Version administration

It's recommended that you schedule database synchronizations followed by scheduled processes for version administration. These processes will allow you to maintain adequate performance as edits are committed to the databases. For more information, see Recommended version administration workflow.