I am trying to export 5 feature classes from Geodatabase to SQLite database using arcpy script. I have ESRI script that creates empty SQLite Database all I need now is just to update the script to make it copy my features classes.

# -*- #################
Tool name: Create SQLite Database
Source: CreateSQLiteDatabase.py
Author: ESRI

Create a SQLite database of the selected flavor: ST_Geometry, SpatiaLite, GeoPackage.

import arcpy
import os
import sys

def create_sqlite_database(in_sqlite_location, geometry_storage):
    """ create a new SQLite database. """

    # Strip the file extension from the location.
    in_sqlite_database = os.path.splitext(in_sqlite_location)[0] 

    # Verify that the target folder exists.
    if not(arcpy.Exists(os.path.dirname(in_sqlite_database))):
        arcpy.AddIDMessage("ERROR", 695)
        sys.exit (1)

    if arcpy.Exists(in_sqlite_location):
        if arcpy.env.overwriteOutput == False:
            arcpy.AddIDMessage("ERROR", 159, in_sqlite_location)
            if __name__ == '__main__':
                print (u'ERROR ' + arcpy.GetIDMessage(159))
                raise arcpy.ExecuteError (arcpy.GetIDMessage(159))

    # Create the SQLite dataset
    arcpy.gp.CreateSQLiteDB(in_sqlite_location ,geometry_storage)

if __name__ == "__main__":
    # Get the parameters from the script tool

The problem is that I cannot use feature class to feature class because in basic licence I cannot copy feature from geodatabase to sqlite database.

I am using ArcGIS Pro 1.3 Basic.

| improve this question | | | | |
  • Please edit your question to include the values you entered in create_sqlite_database(arcpy.GetParameterAsText(0), arcpy.GetParameterAsText(1)). Also include the code snippet you've tried for exporting from geodatabase to sqlite. – Midavalo Feb 11 '17 at 17:41
  • Have you tried using arcpy.Copy_management()? – Midavalo Feb 11 '17 at 18:28
  • Well when I use feature class to feature class with advance licence it allow me to export sqlite dB but when I try it on basic licence it is locked. That's why I am trying now to create script which will do the same thing – Losbaltica Feb 11 '17 at 19:06
  • My values are just a normal feature class which I would like to export to sqlite dB. I would be really helpful if I could somehow put as many feature class I would like , similar to tool like merge when you can add many shp at the same time – Losbaltica Feb 11 '17 at 19:11
  • 2
    please edit your question to include your input parameters, and the code you've tested to perform the copy/export – Midavalo Feb 11 '17 at 19:13