I'm rebuilding NestedBird in Spring Boot and Vue for Sound of Jersey. I'm keeping the old database's places, gigs, bands and music. I've spent time collecting those.
The old PHP site already knows how to read its own records, so I can make it do the exporting. There's a button in the admin called “Generate New SQL”. It writes a script I can look through before loading it into the new database.
Which is useful, because that script starts by emptying the destination tables. I'd like a chance to read it before doing that.
Keep the gig attached to the venue
The old site gives a venue a number. The new one uses a UUID, a long identifier that looks nothing like it. I'm thinking ahead to spreading database work across machines. UUIDs would let those machines make IDs without sharing one counter. For this export, I need to connect the new IDs to the old ones. Say a venue has ID 17, and a gig stores 17 as its location, then I give the venue a new ID and the gig's reference has to change too. Otherwise I've moved the venue and left the gig pointing at its old address.
Using made-up names for the new IDs:
Old place 17 → New place venue-A
Old event 42 → New event event-B
Event's place 17 → Event's place venue-A
I keep a lookup from each old ID to its replacement (a little address book). As I export a venue, I add its pair to the lookup, so when I reach its gigs I can find the new venue ID they need instead of reusing 17.
So venues go before gigs. Artists, then songs, then their media. I can use the lookups as I go, provided I don't try to move a gig before its venue is there.
Put the wardrobe in before trying to hang the clothes.
I don't need to take everything
The new guide needs music and listings. I'm leaving accounts, forum threads and payments out of this export. Moving those as well would give me several more things to rebuild before I could use the data I actually want.
A song only comes across if its artist does. Media follows its song. If the artist or song isn't in the lookup, I skip the records that depend on it rather than give them a broken reference.
It's quite tempting to bring everything across because I've already spent time on it. But I've got enough to do with the music and events. Those are the records I'm moving first.