It's no problem that the forum was created prior to the course being set to separate groups. What matters is that students are in groups before they post, then their post is identified as being for a particular group only. Teachers or other users with permission to view all groups will see groups listed on the forum page.
Roles and permissions
Permission to control users' ability to view forum posts from a group that they are not part of
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.