Export an Existing Realm Application¶
As you develop a Realm app, you might want to share the codebase with team members, make a backup, or work with a version control system like Git. MongoDB Realm's export functionality makes this possible.
You can export Realm apps to a local application
directory from the Realm UI or with the
Exported application directories use the same name as the Realm app by default. Every configuration file must conform to its configuration file schema.
Export from the Realm UI¶
The simplest way to export a Realm app is directly from the Realm UI. To do so, click Deploy in the left-hand navigation, select the Import/Export App tab, and then click the Export App button.
Realm apps can be exported programmatically via the
Command Line Interface
Before beginning, ensure that you have properly installed
Run the Export Command¶
Run the following command to export your application as a directory in the specified output path:
realm-cli export --app-id=myRealmApp-abcde --output=path/to/exported/dir
If the directory specified by
--output already exists,
realm-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
Only entities that are configured in your application will appear in your exported application directory. See Application Configuration Files for more information on the schema and contents of Realm apps.
yourRealmApp/ ├── config.json ├── secrets.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
- You can use Realm's export functionality to share your codebase, make a backup, or work with a version control system.
- You can export Realm apps with the Realm UI or with the