I'm so sorry that happened to you. It sounds horrific, and I completely understand why you're feeling anxious about your son starting secondary school given your own experience.
I don't think, as I think you know deep down, there is a magic formula to avoid being a target, and making any suggestions about it feels victim-blamey. That said, I have three teens and I went to secondary school too (and didn't enjoy it much, though wasn't bullied, just tricky friendships and general low mood throughout my teens), and I know that some kids rise to the top of the year group socially and others have a hard time and often it's for no obvious reason.
I think to a large extent you have to trust the process for now, and try to tell yourself about any positives there are. Has your son formed good friendships at primary. Will any of them be at his school if so. Does he have interests that are likely to be shared by his peers (football, gaming, music, etc etc). Do you have any friends with kids at the school, or who are going. I may be missing the mark with those, but there must be some reassuring or positive facts you can think about.
My kids have all got on OK with secondary so far - none of them are the super-popular kids, but they've all got nice friends and acquaintances. DS found it quite hard in Y7 (wasn't bullied himself, but was a bit scared of another boy in his wider friendship group and struggled a bit with some of the racism/homophobia among boys his age), but settled well by Y8. And one of my eldest's friends had an unpleasant bullying experience in Y8, but has since settled happily into a nice group of kids and their group stays away from the bullying group, who don't engage them either. I mention that as an example that one awful incident doesn't necessarily mean it's all going to be awful, I don't know if that feels helpful.
In answer to your questions, in my experience they didn't do that much inviting new friends round at first, but it built up over time. Sleepovers still a thing for all of them, especially around birthdays. Also meals out (burgers, pizza express etc popular for birthdays). If you can, take your lead on that kind of stuff from his friends' parents with older kids - my eldest was an Easter birthday, so we were able to see what happened (roller disco, cinema etc in her case). And I offered a lot of lifts home from after school clubs etc so I got to meet some of their friends in the early days - well worth doing if you're in a position to (but the world won't fall in if you're not!!).
I've rambled a bit, sorry. I also wonder if it would help you to offload some of your own anxieties more (friends, partner, on here...). I've found my kids' teens quite difficult sometimes as I really have projected my own experiences and anxieties on to their situations and it's very hard not to do it but I don't think it helps.