Saturday, 23 April 2016

Data Loader CLIq (Command Line Interface quickstart)

Introduction:

Data Loader is tool provided by Salesforce for bulk import or export of data. Sometimes, we come across many scenarios where we want to automate the operations or we perform the same task repeatedly.

In this case, we can use Salesforce Data Loader Command Line Interface (CLI).

CLI runs Data Loader from the command line but it is challenging and difficult to set up. So there CLI quickstart (CLIq) comes into help. It will generate all required files for Command line data loader.

  Installation Steps:

  •  Install Data Loader version 17.0 or later.
  • To download Data Loader, login to Salesforce and go to
       Set Up -> Data Management -> Data Loader -> Download Data Loader
  • Download the latest version of CLIq
          https://code.google.com/archive/p/dataloadercliq/downloads
  • Unzip cliq.zip and copy & paste the ‘cliq’ folder into your Data Loader home directory
      Typically, this is: C:\Program Files\salesforce.com\Data Loader\cliq



 Configuration Steps:


Go to C:\Program Files\salesforce.com\Data Loader\cliq and open cliq.properties file for proxy settings.




Note: By default, cliq will set for Production. To use it for the sandbox, uncomment line 23 (remove # and save it).


Let’s Get Started – (Part 1 – Data Export)

To run CLIq, run cliq.bat on Windows (cliq.sh on UNIX).


1. Choose an Operation
2. Enter the process name (string). Example: Export_ Accounts


3. Click on Next and enter your org credentials (username, password + security token)
4. Enter Query (Export) or Entity (Object API Name).



5. Review results and create Data Loader CLI Files


Note: When trying to run process.bat for Salesforce Data Loader from the command line, I encountered an error, "The system cannot find the path specified".

Follow the below steps to resolve the error:


1) Create a folder dataloader (no spaces) in C:\ drive (C:\dataloader)
2) Copy dataloader.jar ,JAVA folder and cliq folder from C:\Program Files\salesforce.com\Data Loader to C:\dataloader
3) Run cliq.bat from cliq folder

A directory will be created with name same as Process name.

·         C:\dataloader\cliq_process\Export_Accounts




As we selected Export Operation, it will automatically create a Export_Accounts.csv file with all data in C:\dataloader\cliq_process\Export_Accounts\write.

Thanks!!

21 comments:

  1. I always wanted to learn this, thanks for sharing this, its really helpful . Awsome post. keep posting much more.

    ReplyDelete
  2. thankz..already success to generate the .bat file but when double click on the file..nothing is process. please help

    ReplyDelete
    Replies
    1. Hey Thanks for reading my bolg.
      Can you please try below steps an let me know if it resolves your problem:

      Follow the below steps to resolve the error:

      1) Create a folder dataloader (no spaces) in C:\ drive (C:\dataloader)
      2) Copy dataloader.jar ,JAVA folder and cliq folder from C:\Program Files\salesforce.com\Data Loader to C:\dataloader
      3) Run cliq.bat from cliq folder.

      Thanks!!

      Delete
  3. Dataloader v39.0 does not install Java folder. In an attempt to run I get the same error. If i tend to copy Java folder from the prior versions it get odd error Unsupported major.minor version 51.0. Please suggest

    ReplyDelete
    Replies
    1. Thanks Gunwinder for reading my blog. Can you please let me know what
      java -version displays?

      Delete
  4. Java 8 version 121

    As far as error log is concerned i get the following:

    C:\newdataloader\cliq>Color 2
    Salesforce Data Loader Command Line Interface Quickstart (CLIq)
    ===============================================================

    Using Java to run CLIq...
    You can download the latest version of CLIq at:
    http://code.google.com/p/dataloadercliq/
    Loading GUI...
    Exception occurred during event dispatching:
    java.lang.UnsupportedClassVersionError: com/sforce/ws/bind/XMLizable : Unsupport
    ed major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)

    ReplyDelete
  5. Hi Sneha, is there no resolution to this issue ?

    ReplyDelete
  6. Hi Sneha,

    I tried all the options mentioned above,its not working. I am using dataloader version 37. Is there any limitation regarding the versions. Is it working for latest tls 1.2 updates or should i use older versions of dataload.

    ReplyDelete
  7. I got out of this mess, Data loader does not install Java instead references JVM or path to Java. Check the path on the batch file.

    Also where it is mentioned to Copy java folder, you would need to copy Java folder from your installed directory (program files / program files x86).

    You may also notice that the Java version installed would reflect as jre1.8.0.121, rename it to Java in the Dataloader directory.

    Cliq.bat should look as:

    set JAVADIR=""
    if exist "..\Java" (set JAVADIR=Java) else (set JAVADIR=_jvm)

    echo Using %JAVADIR% to run CLIq...
    ..\%JAVADIR%\bin\java.exe -Xmx256m -Djava.dir=%JAVADIR% -cp cliq.jar;..\*;lib\miglayout-3.7.1.jar;. com.salesforce.cliq.DataLoaderCliq %1

    pause

    TLS 1.0 is going to be enforced in June and the running user for Dataloader (old versions) show using TLS 1.0, if latest version of data loader is used one would not see it in the login history report.

    ReplyDelete
    Replies
    1. Hi,
      Is Cliq supported for TLS v1.2. I installed latest Data Loader version (39). I am getting error "System cannot find the path". Can you please help. Thanks!

      Delete
  8. Hi,
    Is Cliq supported for TLS v1.2. I installed latest Data Loader version (39). I am getting error "System cannot find the path"

    ReplyDelete
  9. I tried to setup Cliq as above instruction with Data Loader v40.
    I get the same error "System cannot find the path" Can you help please

    ReplyDelete
  10. See my comment Piyush & Jay, hope you will get the answer.

    ReplyDelete
    Replies
    1. I have followed all steps as mentioned above i am running against version 40 of data loader. I am getting following error while trying to run cliq.bat file. Path environment variable is set correctly
      Using Java to run CLIq...
      Exception in thread "main" java.lang.NoClassDefFoundError: com/salesforce/cliq/D
      ataLoaderCliq
      Caused by: java.lang.ClassNotFoundException: com.salesforce.cliq.DataLoaderCliq
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      Could not find the main class: com.salesforce.cliq.DataLoaderCliq. Program will
      exit.

      Delete
  11. Hi
    My data loader version is 41.0.0
    I am getting error "System cannot find the path". Can you please help. Thanks!

    ReplyDelete