Realm-cli export excludes all values

I’m using realm-cli export to export my realm app for importing into another project. Regardless of the options I choose, the values folder is always empty, even though the docs specify values should be exported. I’ve tried with and without the following options: --as-template, --for-source-control, --include-hosting.

The app that I am exporting has both Secret and Environment-type values. I understand secrets won’t be exported, but I expect environment values to be exported. How can I do this?

1 Like

Hi Haotian,

The environment values are stored in it’s own directory named environments/
Please see the app structure below:

Regards
Manny

Thank you Masoor. But when I try to import my exported realm app somewhere else, the environment variables do not show up back in the “values” tab. Is this expected?

When I import the app either with --replace or --replace-with-name, I get the following diff:

--- environments/development.json
+++ environments/development.json
@@ -1,5 +1,2 @@
-{
-    "value1_name": "value",
-    "value2_name": "value",
-}
+{}


--- environments/testing.json
+++ environments/testing.json
@@ -1,5 +1,2 @@
-{
-    "value1_name": "value",
-    "value2_name": "value",
-}
+{}


--- environments/qa.json
+++ environments/qa.json
@@ -1,5 +1,2 @@
-{
-    "value1_name": "value",
-    "value2_name": "value",
-}
+{}


--- environments/production.json
+++ environments/production.json
@@ -1,5 +1,2 @@
-{
-    "value1_name": "value",
-    "value2_name": "value",
-}
+{}

Hi Haotian,

What is your realm-cli version? Please run realm-cli --version

It’s possible that you’re using the Legacy Structure.

Please check the local app directory you’re trying to import and check if the structure complies with the Legacy structure or the Modern Structure. You may need to update your realm-cli version and do the export/import process again.

Regards
Manny

Hi Manny,

My realm-cli version turned out to be 1.2.0. I’ll update to 2.0.0 and will see if that fixes the issue

1 Like