Not savvy about AMD, but from what I understand, the Ryzen benefits from higher clocked RAM, like in the 3000-3200 MHZ or even greater range. So consider that if you're keeping your 2400 MHZ ram.
Source
Just to tell you: your Z170 board is at the uppermost limit of compatibility with the 7700K. In theory, it should work, but you need to try it yourself and see if your board accepts it and boots with it. 8 threads for the 7700K versus only 4 threads for your i5, so the i7 would be clearly superior in gaming.