Moving data from SQL Server 2012 to ElasticSearch

Hi @rrmave,

your problem is unrelated to Elasticsearch. You use Unix features in a Windows batch script, that's why it fails.

The docs of the importer say, that you can also provide the parameters in a file and this seems to be the better (only?) option in your case:

So I guess you need to do something along these lines:

"%JAVA_HOME%\bin\java" -cp "%LIB%" -Dlog4j.configurationFile="%BIN%\log4j2.xml" "org.xbib.tools.Runner" "org.xbib.tools.JDBCImporter" "statefile.json"

where statefile.json contains your parameters:

{
  "type": "jdbc",
  "jdbc": {
    "url": "jdbc:sqlserver://localhost:;instanceName=;databaseName=",
    "user": "",
    "password": "",
    "sql": "",
    "treat_binary_as_string": true,
    "elasticsearch": {
      "cluster": "elasticsearch",
      "host": "localhost",
      "port": 9200
    },
    "index": "record",
    "type": "record"
  }
}

Daniel