Jacob-Griffin / TelephonePictionary2.0

New version of blowyourfaceoff.com using more modern web technology than php and raw javascript
https://byfo.net
0 stars 0 forks source link

Migrate old games from blowyourfaceoff.com #30

Closed Jacob-Griffin closed 3 weeks ago

Jacob-Griffin commented 1 year ago

The last little bit that has to happen before we finish the move and host this app on blowyourfaceoff.com is we have to get the previous games off of the old database and into the new format/on firebase. Might take a bit of effort to transform the data and upload it in a way that respects rate limits.

Jacob-Griffin commented 9 months ago

This shouldn't be too hard. The old game has a game_data table that can be exported as JSON, which I can then pretty easily reassemble on the new side

Step 1: The old data

  1. Export the old table (game_data) as JSON
    • This should be an array of objects, each representing a row
  2. Take the row-wise data and make a new JSON ordered as gameid > stack owner > [cards]
  3. For every image, convert to blob and run it through the image upload function to get the new url

Old:

[
  {
    GameID: number,
    ImgRef: string,
    Round: number,
    StackOwner: string,
    Player: string
  }
  ...
]

(ImgRef is both content types)

New:

{
  [gameid: string]: {
    [stackOwner: string]: {
      content: string,
      contentType: string,
      from: string
    }
  }
}

Step 2: Getting it in the new system

A: FireStore

So this process is a little bit involved, but mostly straightforward, and something I can write a script for

Jacob-Griffin commented 1 month ago

Timeline on this:

  1. We want to make sure the stable version is stable, and there's no major issues like #51 left
  2. We want to transfer the domain first so that no new games can be created on the old one and it's locked in
  3. Then we can proceed to this transfer
Jacob-Griffin commented 3 weeks ago

Data exists and I seem to be able to transfer it just fine. Enhancements needed to fully support the migrated data:

Jacob-Griffin commented 3 weeks ago

Everything seems good to go. Starting the process tomorrow

Jacob-Griffin commented 3 weeks ago

Process seems to have gone smoothly. All enhancements are in, and all data is transferred