When livejournal went into the nosedive from which it never recovered, a bunch of code base clones attempted to fill the void. By far the most carefully planned and executed of the LJ replacements was dreamwidth, still up and running to this very day. Here's a writeup of advice from Denise, a founding member of dreamwidth, speaking one admin to another, on what legal issues to anticipate and how to head them off before they become a problem. It's divided into discrete sections and comes complete with relevant links and detailed instructions about what to do with those links where applicable.
Denise is not, to my knowledge, a lawyer, and is not pretending to give that kind of legal advice. Just someone with a ton of relevant experience to speak from, who was good enough to write it up specifically for the use of Mastodon admins.