Skip to main content

Using MarkLogic Content Pump (mlcp)

Optional: Create an Options File

You can encapsulate mlcp command line options in an options file; for details, see Options File Syntax. An options file is convenient for re-use of commonly used options. Also, using an options file can help you avoid command line interpolation of quotes by the shell.

The examples use an options file to save MarkLogic connection related options so that you can easily re-use them across multiple commands. This section describes how to create this file.

If you prefer to pass the connection options directly on the command line instead, add -username, -password, -host, and possibly -port options to the example mlcp commands in place of -options_file.

Use the following procedure to create the example options file:

  1. If you are not already at the top level of your work area, change directory to this location. That is, the gs folder created in Prepare to Run the Examples.

    cd gs
  2. Create a file named conn.txt with the following contents. Each line is either an option name or a value for the preceding option.

    -username
    your_username-password
    your_password-host
    localhost
    -port
    8000
  3. Edit conn.txt and modify the values of the -username and -password options to match your environment.

  4. Optionally, modify the -host and/or -port option values. The host and port must identify a MarkLogic Server App Server that supports the XDBC protocol. MarkLogic Server comes with an App Server pre-configured on port 8000 that supports XDBC, attached to the Documents database. You can choose a different App Server.

You should now have the following file structure:

gs/
  conn.txt
  import/
    one.xml
    two.json