question

ebrahimB avatar image
ebrahimB asked

Parse migration error

I am trying to move my parse data to playfab and have been using the migration tool, but I am getting the following error: 

Unexpected content in data file: missing StartObject

I don't have any users stored in the parse backend. I really only used parse to store data for promocodes (i.e. store code, who the code was for, and whether they redeemed it). I figured I could do the same thing using playfabs title data. The JSON file that I need to import from the parse backend looks like this: 

{ "results": [
{
"code": "AAAAAAAA",
"createdAt": "2015-01-12T20:56:10.013Z",
"email": "me@gmail.com",
"identifier": "1111111111111111111",
"objectId": "01Hk6fkDV8",
"redeemed": "1",
"reward": "FULL_GAME",
"updatedAt": "2015-01-14T06:14:04.924Z"
},
...
]}

Is there a way for me to import this data into Playfab? It does not seem like there is an import option for the title data.

 

Note: I have around 1.27k codes in the JSON file

 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Yes, as stated in the Parse migration guide, what we're specifically doing us importing all your player data, so that you can move the complete history of all your users into PlayFab easily. For title-level data, I would normally recommend writing the information into Title Data using our Admin API calls. However, what you really have here is an event history for the consumption of all the promo codes for your game, which wouldn't really be a good fit for Title Data. Since these are user-specific, your best bet would be to write them to the individual user accounts as either user read only or user internal data. But this is a fairly game-specific mapping, so you'll need to use the existing Server/Admin API calls to accomplish this. How much data is this, all told? One option might be to store it in S3, and have the players check it for their own promocode usage at login.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ebrahimB avatar image
ebrahimB answered

Thanks for getting back to me. 

 

The file size is about 360KB. I am fairly new to playfab so I am not 100% sure as to what you are suggesting. In general, I'd like to be able to store the data and just test a string against all the "identifier" elements and pull the object that matches. 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Well, let's break down the data needs, then. From what you have, it sounds like it's player-specific, right? What I'm suggesting is that you could store the data either in the Content service, or else break it up by player and store it in the individual players' data spaces in the service. If you have email addresses associated with all users, the latter would probably be the best thing to do, since you could do the lookup on each user and write their data out - that way, you don't risk exposing email addresses to users.

So in other words, you'd write a tool which uses https://api.playfab.com/Documentation/Client/method/GetAccountInfo to look up the players by email address, then writes the data for the users into their individual data using one of these API calls:

https://api.playfab.com/Documentation/Server/method/UpdateUserData

https://api.playfab.com/Documentation/Server/method/UpdateUserReadOnlyData

https://api.playfab.com/Documentation/Server/method/UpdateUserInternalData

Though we also have Publisher-level data (just put Publisher in after "UpdateUser" in the API name to find them), so you could store the data there, if you want it shared across all your titles.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ebrahimB avatar image
ebrahimB answered

It is player specific, correct.

 

After giving it some thought, I think we won't import the parse data. Instead, we can slowly integrate a custom system in playfab and should hopefully have it up and running before next January when parse shuts down.

 

Thanks for your help! You guys have great customer service! 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Thanks! And yes, there's always the option of reading that extra data from Parse through January and writing it to the PlayFab player record. Then, you could just do a quick pass on the data before they shut down, to confirm if you have any outstanding players who just haven't signed in for a while and decide what to do about them.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.