Export an Existing Stitch Application

MongoDB Stitch applications can be exported to a local application directory from the Stitch UI or with the stitch-cli export command.

Exported application directories use the same name as the Stitch application by default. All entities in the application directory conform to the Application File Schema.


Export from the Stitch UI

The simplest way to export a MongoDB Stitch application is directly from the Stitch UI. To do so, click Deploy in the left-hand navigation, select the Import/Export App tab, and then click the Export App button.


Export with stitch-cli

MongoDB Stitch applications can be exported programmatically via the Command Line Interface (stitch-cli).

Before beginning, ensure that you have properly installed stitch-cli.


Authenticate a MongoDB Atlas User

To export a MongoDB Stitch application with stitch-cli, you must first authenticate your Stitch CLI session using a MongoDB Atlas programmatic API key associated with your MongoDB Cloud account.

stitch-cli login --api-key=my-api-key --private-api-key=my-private-api-key

Run the Export Command

Run the following command to export your application as a directory in the specified output path:

stitch-cli export --app-id=myStitchApp-abcde --output=path/to/exported/dir


If the directory specified by --output already exists, stitch-cli will throw an error and the export will fail.


Your application will be exported to a local application directory. If you did not specify a path for the directory with --output, it will be exported with the same name as the application into the current working directory.

Only entities that are configured in your application will appear in your exported application directory. See Application File Schema for more information on the schema and contents of MongoDB Stitch applications.

├── stitch.json
├── auth_providers/
│   └── <provider name>.json
├── functions/
│   └── <function name>/
│       ├── config.json
│       └── source.js
├── services/
│   └── <service name>/
│       ├── config.json
│       ├── incoming_webhooks/
│       │   ├── config.json
│       │   └── source.js
│       └── rules/
│           └── <rule name>.json
├── triggers/
│   └── <trigger name>.json
├── hosting/
│   ├── metadata.json
│   └── files/
│       └── <files to host>
└── values/
    └── <value name>.json