Connect to an enterprise geodatabase

In this first module, you’ll connect to an enterprise geodatabase. Branch versioning is only possible with an enterprise geodatabase. Then you’ll copy the Madrid data from a local file geodatabase to the enterprise geodatabase.

Make a database connection

To begin, you’ll make a new database connection to an enterprise geodatabase that will act as the primary data storage for the Madrid solar project. You will make the connection as a data owner, that is, a database user who can load data.

Note:

This tutorial requires an enterprise geodatabase and a database user account with read and write access (a data owner account). If you don’t have these things, follow the steps in Deploy an enterprise geodatabase for real estate. Only the first four sections of that tutorial are required to complete this one; you can stop after running the Create Database User tool.

  1. Download the MadridSolar project package.

    A file named MadridSolar.ppkx is downloaded to your computer.

    Note:

    .ppkx file is an ArcGIS Pro project package and may contain maps, data, and other files that you can open in ArcGIS Pro. Learn more about managing .ppkx files in this guide.

  2. Locate the downloaded file on your computer. Double-click MadridSolar.ppkx to open it in ArcGIS Pro.

    A map appears, centered on Madrid. There is no data present aside from the basemap.

    Basemap centered on Madrid, Spain

  3. In the Catalog pane, on the Project tab, right-click the Databases folder and click New Database Connection.

    New Database Connection

    The Database Connection window appears. You’ll fill in the parameters of this window to create a connection to the enterprise geodatabase you plan to use throughout this tutorial series.

  4. For Database Platform, choose the database management system that was used to create your enterprise geodatabase, for example, SQL Server.
    Note:

    This tutorial series illustrates how to enable branch versioning on an enterprise geodatabase using SQL Server as the database management system. You can also follow this tutorial if you are using another supported DBMS, such as Oracle, IBM Db2, PostgreSQL, and SAP HANA.

    If you select a Database Platform other than SQL Server, the remaining parameters in the Database Connection window will differ from those described below.

  5. For Instance, type the name of the instance that was used to create your enterprise geodatabase, for example, MadridSQL.
  6. For Authentication Type, choose Database authentication.

    This is the most widely used authentication type.

  7. For User Name, type the username of a database user account with read and write access to the enterprise geodatabase.
    Tip:

    If you created your enterprise geodatabase following the Deploy an enterprise geodatabase for real estate tutorial, type GIS.

    This user will become the data owner.

  8. For Password, type the password associated with the chosen database user account.
  9. Ensure that the Save User/Password check box is checked.
  10. For Database, choose the enterprise geodatabase, for example, MadridSolar.
  11. For Connection File Name, type a name following the pattern database name_database user, for example, MadridSolar_GIS.

    This is the recommended naming convention for database connections.

    Database Connection window

    Note:

    Your tool parameters will differ from the ones shown in the image above. Enter connection properties specific to your database platform. For more help, see the Set up a database connection documentation.

  12. Click OK.

    A new database connection appears in the Catalog pane.

    MadridSolar_GIS.sde database connection

Load data into the enterprise geodatabase

The project contains a file geodatabase, madrid_solar.gdb, with two feature classes. You’ll move this data into the newly connected enterprise geodatabase so it can be used for branch versioning.

  1. In the Catalog pane, on the Project tab, in the Databases folder, click the arrow next to madrid_solar.gdb to expand it.

    Expander button next to madrid_solar.gdb

    The file geodatabase contains two feature classes. Buildings represents the solar potential of roofs in the Arganzuela district of Madrid. Neighborhoods represents the boundaries of the seven neighborhoods in Arganzuela. The Madrid solar project will eventually assess all of the buildings in Madrid, but so far, only this district has been assessed.

  2. Drag the Buildings feature class onto the enterprise geodatabase connection (for example, MadridSolar_GIS.sde.)

    Buildings layer moving from the file geodatabase to the enterprise geodatabase

    It may take a few minutes for the data to copy into the enterprise geodatabase.

  3. Drag the Neighborhoods feature class onto the enterprise geodatabase connection as well.
  4. Expand the enterprise geodatabase connection.

    The enterprise geodatabase now contains two feature classes, copies of the two in the file geodatabase.

    Two feature classes in each geodatabase

    The name of each feature class is prepended with the name of the database user, for example, GIS.Buildings. This is the fully qualified name, a pattern that helps to indicate the data owner of each feature class in the database and to prevent duplicate names.

    Tip:

    If the enterprise geodatabase still appears empty, right-click the connection and click Refresh.

  5. In the Catalog pane, click the arrow next to madrid_solar_project.gdb to collapse the file geodatabase.

    You won’t be using the file geodatabase in the rest of the tutorial.

In this module, you created a connection to an enterprise geodatabase as a data owner and copied two feature classes into it.


Prepare the data for branch versioning

Editing all of the data for this project will require multiple people. You want them to all be able to do their work at the same time, rather than taking turns. You want them to be able to undo and redo their edits, and you want to detect and resolve any conflicts that might occur, for example, if two people enter different values for the same feature. You can achieve all of these things with branch versioning.

In this module, you’ll prepare the data for versioning. You’ll configure the database connection for branch versioning, and you’ll register the feature classes as branch versioned.

Configure the database connection for branch versioning

When working with branch versioned data, it is important for publishing and administration workflows to set the versioning type of the database connection to branch.

  1. In the Contents pane, right-click the enterprise geodatabase connection (for example, MadridSolar_GIS.sde) and click Geodatabase Connection Properties.

    The Database Connection window appears.

  2. On the Geodatabase Connection Properties tab, for Versioning Type, choose Branch.

    Versioning Type set to Branch

  3. Click OK.

Register feature classes as branch versioned

Before you can edit a dataset in a version, you must register the dataset as versioned.

  1. In the enterprise geodatabase connection, right-click the Buildings feature class (for example, GIS.Buildings) and click Manage.

    Manage

    Note:

    If you are using a version of ArcGIS Pro older than 2.9, right-click each feature class in the Catalog pane, point to Manage, and turn on Add Global IDs, Enable Archiving, and Enable Editor Tracking. Right-click each feature class again, point to Manage, and click Register As Versioned. Skip to the next module.

  2. In the Feature Class Properties window, on the Manage tab, check the Versioning check box.

    More parameters appear.

    Manage geodatabase functionality set to Versioning

  3. Ensure that the Branch option is selected. Click OK.

    Next, you’ll register the Neighborhoods feature class in the same way.

  4. In the Catalog pane, in the enterprise geodatabase connection, right-click the Neighborhoods feature class and click Manage.
  5. Check the Versioning check box and ensure that the Branch option is selected.
  6. Click OK.

The data is now registered as branch versioned and the database connection is configured for branch versioning. With these configurations complete, you’re ready to share the data as a web feature layer (a feature service) so other people can access and edit it.


Publish the data as a web feature layer

Branch versioning uses a service-based architecture, which means that you must publish the data as services.

In branch versioning, the data must be registered as branch versioned and published from an enterprise geodatabase. You have already loaded the data into an enterprise geodatabase and registered it as branch versioned. The next step is to publish the data to your ArcGIS Enterprise portal.

Add layers to the map and set symbology

To publish the data, you must first add the two feature classes to a map. You’ll also change the symbology of the two layers before sharing them, to make the editing experience easier. You’ll apply symbology and labeling properties with provided layer files.

  1. From the Catalog pane, from the enterprise geodatabase connection (for example, MadridSolar_GIS.sde), drag the Neighborhoods and Buildings feature classes onto the map.

    Map of Madrid buildings and neighborhoods

    The data appears on the map. The colors are randomly assigned. You’ll change them to make the map easier to read.

  2. In the Contents pane, click the Buildings layer (for example, GIS.Buildings) to select it.

    You’ll use the Import Symbology tool to set the symbology of the layer using properties provided in a layer (.lyrx) file.

  3. On the ribbon, click the Feature Layer tab. In the Drawing group, click Import.

    Import button on the ribbon

  4. In the Import Symbology window, ensure that Input Layer is set to the Buildings layer (for example, GIS.Buildings).
  5. For Symbology Layer, click the Browse button.

    Browse button

  6. In the Symbology Layer window, double-click the commondata folder.

    commondata folder

    Tip:

    If you can't find the commondata folder, in the navigation pane, expand Project, Folders, and MadridSolar.

  7. Double-click the userdata folder and select the Buildings.lyrx file.

    Buildings.lyrx file

  8. Click OK.

    The remaining parameters are populated in the Import Symbology window.

    Import Symbology window

  9. Accept the default parameters and click OK.

    The symbology of the Buildings layer updates. Roofs with a higher solar potential are shown in dark red, while roofs with a lower solar potential are shown in orange and yellow. All of the buildings in the Imperial neighborhood are yellow because the solar potential values have not yet been calculated for this area.

    Buildings symbolized with a yellow to red color scheme.

    Next, you’ll change the symbology of the Neighborhoods layer in the same way.

  10. In the Contents pane, click the Neighborhoods layer to select it. On the ribbon, click Import.
  11. In the Import Symbology window, for Symbology Layer, click the Browse button. Choose the Neighborhoods.lyrx file and click OK.

    Symbology Layer set to Neighborhoods.lyrx

    The Symbology Fields parameters are blank. This is expected, because the symbology that you are applying is not based on any fields.

  12. Click OK.

    The layer updates to a symbol with no fill color and black outlines.

    Labeled neighborhoods on the map

    The layer file also changed the labeling properties of the layer, so each neighborhood is now labeled with its name.

Share the data to your portal as a web feature layer

Now that the data is properly symbolized, you are ready to share it to your portal. You’ll use the Share As Web Layer pane to publish the feature classes from your enterprise geodatabase as a web feature layer. The editing will be performed on this web feature layer.

To publish, you must first connect to your ArcGIS Enterprise portal with a portal account that has publishing privileges.

  1. Above the ribbon, click Not signed in and click Sign in.

    Sign in

  2. In the ArcGIS Sign In window, type the username and password for the portal account. Click Sign In.
  3. On the ribbon, click the Share tab. In the Share As group, click the Web Layer button.

    Web Layer button on the ribbon

  4. In the Share As Web Layer pane, set the following properties:
    • For Name, type Madrid Solar Project.
    • For Summary, type Solar potential of each building roof in Madrid.
    • For Tags, type CENER, solar potential, Madrid, branch versioning, Esri. Press Enter.

    Share As Web Layer pane

    The sharing process will create one web feature layer that contains two sublayers, one for the buildings data and one for the neighborhoods.

    Under Data and Layer Type, you can choose Reference registered data or Copy all data. Branch versioning will only work if the web feature layer references registered data. When you choose to reference registered data, any changes you make to the web feature layer, such as adding, updating, or deleting features, will be reflected in the enterprise geodatabase. If you choose to copy the data instead, a web feature layer containing the data will be published, but it will have no connection to the enterprise geodatabase and version management won't be enabled.

  5. Under Reference registered data, ensure that Map Image is selected. Check the Feature check box.

    Map Image and Feature selected under Reference registered data

  6. Scroll down. For Share with, check the ArcGIS Enterprise check box.

    This check box ensures all members of your organization will have access to this web layer.

    ArcGIS Enterprise selected under Share with

    Next, you’ll enable the Version Management capability. This capability will allow you to take full advantage of branch versioning, for example, to create, modify, and delete versions, and to reconcile and post edits for versions.

  7. At the top of the pane, click the Configuration tab. Under Capabilities, check the Version Management check box.

    Version Management checked on the Configuration tab

  8. Click the Configure Pooling button. For Instance Type, choose Dedicated instance.

    Dedicated instance selected on the Configure Pooling tab

    This is a requirement for publishing branch versioned data.

Note:

You can read more about sharing parameters in the Share branch versioned data documentation.

Fix analyzer errors and publish

Before you click the Publish button, you’ll analyze the feature layer to learn whether anything needs to be fixed before publishing can succeed.

  1. At the bottom of the pane, click Analyze.

    Analyze button

    The pane displays the Messages tab. It lists a number of analyzer warnings and two analyzer errors. You need to address the errors before you can complete the publishing process.

    Two analyzer errors

  2. Click the arrow next to the first error to expand it.

    Expander button next to the first analyze error

    This warning indicates that the source for both layers is not registered with the server. You will address this by registering your enterprise geodatabase with ArcGIS Server.

  3. Under the first error message, right-click the first submessage and click Register Data Source With Server.

    Register Data Source With Server

    The Add data store window appears.

    Recall that your goal in this sharing process is to create a web layer that references the data stored in your enterprise geodatabase, rather than to make a web layer that is a copy of that data. To achieve this, you need to register your enterprise geodatabase as a data store with your ArcGIS Server site. This will ensure that the web feature layer published to your portal references the feature class in your enterprise geodatabase. You can think of the data store as the connection between your ArcGIS Server site and the enterprise geodatabase.

  4. For Title, type MadridDataStore.
  5. For Tags, type CENER, solar potential, Madrid, branch versioning, Esri.
  6. Click the Validate button to validate your server connection.

    Validate button

  7. For Share with, check the ArcGIS Enterprise check box.

    Share with set to ArcGIS Enterprise

  8. Click Create.

    In the Share As Web Layer pane, a green check mark appears next to the first submessage to indicate that the layer’s data source is now registered with the server. Since both the Buildings and Neighborhoods layers have the same data source, you don’t need to repeat these steps for the second submessage; creating one data store will resolve this error for both layers.

    Green check mark next to one of the analyze errors

    Next, you’ll address the second error.

  9. Right-click 00374 Unique numeric IDs are not assigned and click Auto-Assign IDs Sequentially.

    Auto-Assign IDs Sequentially

    This is a requirement when sharing a web layer. It ensures layer IDs remain static when the web layer is overwritten.

    A green check mark appears next to the error.

  10. At the bottom of the pane, click Publish.
  11. When publishing is complete, click the Manage the web layer link.

    Manage the web layer

  12. If prompted, sign in with the same portal user account you used to sign in to ArcGIS Pro.

    Your portal appears, showing the item page for the Madrid Solar Project map image layer that you just created.

    Madrid Solar Project item page

  13. On the ribbon, click the Content tab.

    There are three new items in your portal: a feature layer, a map image layer, and a data store. All three items are shared with your organization.

    Three items on the Content page of the portal

  14. For the Madrid Solar Project item, click the arrow next to Feature layer.

    Sublayers of the Madrid Solar Project feature layer

    The Madrid Solar Project web feature layer contains two sublayers: Buildings and Neighborhoods. In the next tutorial, you will add these layers to a map in ArcGIS Pro and edit them.

  15. Close the web browser and ArcGIS Pro. There is no need to save the project.

In this module, you added the two feature classes to the map and applied symbology to better represent the solar potential of each building. You then published the data with the Version Management capability enabled and addressed two analyzer errors.

In this tutorial, you made a database connection to an enterprise geodatabase and loaded two feature classes into it. You prepared the data for publishing by registering the datasets as branch versioned. Finally, you connected to the portal with an account with publishing privileges and published a new web feature layer named Madrid Solar Project.

You will use this web feature layer to calculate and report solar potential for each building. Because it is branch versioned, multiple users in the CENER organization will be able to edit this data at the same time, allowing the project to progress faster.

In the next tutorial, Make edits in a branch version, you will learn how to consume the web feature layer in ArcGIS Pro, create named versions, connect to a named version, and perform edits.