Exporting a Database Collection

Collections serve as generic repositories that hold any data in key-value pair format. It acts as interfaces to enter and modify data into the AppViewX Mongo database. Data from collections is consumed as a part of the provisioning request process or by any other scripts that are triggered by AppViewX. The structure of the collections is based on the Mongo database.

To export a mongo database collection:

  1. Login to Kubernetes dashboard UI with the token.
  2. From the top section, select the avx namespace.
  3. Click pods and search for mongo-routerdb-0.
  4. Click on the three dots icon and select Exec.
  5. To navigate to the logs directory, execute the following command:
    cd /appviewx/dependencies/logs
  6. Check if export_collection directory is available. Otherwise, to create the directory, execute the following command:
    mkdir export_collection
  7. To navigate to the export_collection directory, execute the following command:
    cd /appviewx/dependencies/logs/export_collection
  8. To export the database collection, execute the following command: Change the fields highlighted in bold with the desired values according to your setup.
    mongoexport --username admin --password <password> --db=appviewx --collection=<collectionName> --out=<fileName>.json --authenticationDatabase admin
    This command will export the collection and the file will be available at the following location: /appviewx/dependencies/logs/export_collection
    Note: The exported file is also available at the following location on the host where the mongodb pod is running: INSTALLATION_PATH/appviewx/logs/export_collection