The vaccine topic has been widely discussed on Twitter since the outbreak of COVID-19. However, the dynamics of temporal opinion shifts at the individual level and the possible reasons of shifts have been little studied. In this paper, we explore the possible influence of social interactions (retweet network) on individual opinion shifts related to vaccinations based on large-scale Twitter data in Japanese. We use an opinion score to measure the dynamic changes of individual opinions and apply dynamic community detection to the retweet network to track changes of communities over time. Then, we combine dynamic opinions and evolving communities to identify the interplay between social interaction and opinion shifts. Our findings suggest that the opinion shifts could be largely influenced by the communities that users are affiliated. Specifically, if users are within the anti-vaccine community, they exhibit a significantly higher likelihood of adopting an anti-vaccine stance. Conversely, if users are linked to pro-vaccine, pet-hobby, or news communities, they exhibit a greater probability of transitioning to a pro-vaccine standpoint. By observing the temporal changes of the influence of communities, after the start of vaccination, the anti-vaccine community’s influence appears to persist with slight drop, while the influence of pro-vaccine, news and pet-hobby communities steadily increased. Our results furnish valuable insights for policymakers and healthcare professionals to better leverage social media for vaccine promotion.