Exporting a Schema Definition Using Connection Properties

You can export a schema definition from a Couchbase database to a local JSON file. Doing so enables you to maintain a backup copy of the schema definition or send the schema definition to other users, if necessary.

You can set the connection properties described below in a connection string or in a DSN (in the odbc.ini file). Settings in the connection string take precedence over settings in the DSN.

To export a schema definition using connection properties:

  1. Set your connection properties as follows:
    • Set the SchemaMapOperation property to 3.
    • Set the LocalSchemaFile property to the full path and name of a JSON file for storing the schema definition locally. If you specify a file that does not already exist, the connector creates it when generating the schema definition.
    • Important:

      Important:

      When you export the schema definition, it overwrites any existing content in the JSON file.

  2. Connect to the database.

When you connect to the database using the settings described above, the connector exports the schema definition from the database to the JSON file.