1

First off, I'm a total novice with regards to Realm so please bare with me.

I have an app on my iPhone that stores data in a Realm db and I'd like to export some values from it. Using iExplorer I copied the db file from an iPhone backup onto my Mac.

I downloaded MongoDB Realm Studio (v. 11.0.1) and opened the db file. I can see the class containing the data of interest and clicked it. Values are shown in columns with headers. I would like to export two of those columns. I wasn't able to select columns and copy them to clipboard which would have been ideal.

I then tried to export the class as JSON but after a few minutes Studio reported "Failed to export data. Invalid string length".

Not having any experience with Realm, is there some command I can enter into Studio's query box to either locate the invalid string length and fixit or to be able to export the desired data?

Thanks!

apta
  • 11
  • 1
  • Welcome to SO. First, get 11.1.0 of Realm Studio and try it. You should be able to locate the issue - open the exported json file with TextEdit and scroll to the end. The last line (the exported field data) will either be the offending line or it could the the one after. You can then find that in the file and possibly correct it. Then again, it could be a bug in that version or Realm Studio - loop us in on the results and if it's a bug, it should be reported. – Jay Jul 09 '21 at 14:58
  • @Jay Thanks for the suggestion but Realm Studio 11.1.0 did the same thing: "Failed to export data. Invalid string length". Since there's no exported file I'm not able to open the json file. Realm Studio was able to export from an accompanying realm file from the same app so I know it's possible. – apta Jul 10 '21 at 21:37
  • Found a solution! I downloaded the legacy Realm Browser 3.0.1 and attempted to open the Realm db but was greeted by a request for "Valid encryption key for this file". Not having the foggiest idea but not discouraged I noted a bunch of output files left by Realm Studio that had the Realm icon. Encouraged, with Realm Broser I opened one with the name ending app.v9.backup.realm and instantly came into view the contents. Realm Browser correctly saved it in CVS. Curious that while Studio successfully converted the original file (v10?) into a v9 format, it hit a snag while exporting as JSON. – apta Jul 11 '21 at 09:27
  • Save issue in MongoDB Realm Studio Version 11.1.1 (11.1.1.42) – hkdalex Feb 14 '22 at 12:26

0 Answers0