Copy and paste data between databases in ArcGIS

Available with Standard or Advanced license.

You can copy data from a database and paste it into another database or an enterprise geodatabase through ArcGIS Pro.

When you move data from one database type to another, the data types used for the attributes in your table may change. For example, if you copy a table from Microsoft SQL Server that has a UniqueIdentifier field and you paste it into a PostgreSQL database, it will be a Varchar field.

Be aware that ArcGIS cannot paste data types or definitions it doesn't support. That means a table or feature class you paste into a database will contain the following:

  • Data types supported by ArcGIS

    Any columns that cannot be mapped to an ArcGIS data type will not be created in the feature class in the target database.

  • One spatial column

    For feature classes, ArcGIS uses the first spatial column it encounters; the second will not be created in the target feature class. If you want to use the second spatial column, define a view or a query layer on the source table that only contains the second spatial column. If you create a view, you can copy the view from the source database and paste it into the target database as a feature class. If you define a query layer, you can export the data from the query layer to a new feature class in the target database.

  • One geometry type

    ArcGIS reads the geometry type (point, line, polygon, or multipoint) of the first feature in the source feature class. Only those features that match the geometry type of the first row will be pasted into the feature class in the target database. If your source feature class contains multiple geometry types and you want to control the geometry type used in the target feature class, create a query layer of the source feature class and define the geometry type for the query layer. Next, export the data from the query layer to a feature class in your target database. The feature class created in the target database will contain only the features that match the geometry type you defined for the query layer.

  • One coordinate setting

    ArcGIS reads the spatial coordinate properties (xy, xyz, xym, xyzm) stored with the first feature in the source feature class. The features in the feature class you paste into the target database will all have the coordinate properties. For example, if the first feature in the source feature class has x,y, and z but not m coordinates, any features that had m coordinate information in the source feature class will not have it in the target feature class. Similarly, any feature that had only x,y coordinates in the source feature class will have x,y, and z coordinates in the target feature class (the z coordinate is set to 0).

    To make sure all coordinate information is preserved in the target feature class, create a query layer of the source feature class and define its spatial properties to include m and z values. Next, export the data from the query layer to a feature class in the target database. All features in the feature class created in the target database will use the spatial coordinate settings you defined for the query layer.

  • One spatial reference

    If your source feature class has a spatial reference defined that ArcGIS recognizes, the same spatial reference is used for the feature class in the target database. If the spatial reference is not defined for the feature class, ArcGIS uses the spatial reference of the first row in the table. Records that do not match that spatial reference are not created in the feature class in the target database. If, instead, the spatial reference cannot be identified for the feature class or the first row (for example, if a custom spatial reference is used), the spatial reference used in the target feature class varies depending on your database management system.

The following steps explain how to move a table, feature class, or view between databases or from a geodatabase to a database using copy and paste:

  1. Connect to both the source and target databases.
  2. Be sure to connect to the source database as a user with privileges to access the data in the source database, and connect to the target database as a user with database privileges sufficient to create tables.
  3. If necessary, prepare the data to be moved.
    • To move a feature class that has records with different dimensionality, geometry types, or spatial references, drag the table onto the map and modify the resultant query layer, choosing one dimensionality, geometry type, or spatial reference. To move the data to the target database, export the query layer. (You can't copy and paste a query layer.)
    • If the feature class has multiple spatial columns, create a database view that includes only one of the spatial columns and proceed with the remaining steps to copy and paste the view.
  4. Right-click the table, feature class, or view in the source database and click Copy.
  5. Right-click the target database in the Catalog pane and click Paste.

    The data in the target database is owned by the login you used to connect to it.

    Note:

    To paste data into a PostgreSQL or SQL Server database, the user connected to the target database must have a schema with the same name as the database user name.

The new table or feature class is created in your destination database.