When John Fogerty walked on stage with Creedence Clearwater Revival after midnight on Aug. 16, 1969, on Max Yasgur’s dairy farm in Bethel, he didn’t realize he was experiencing a pivotal pop culture moment in real-time. He just wanted to wake up the crowd.

“My band was slated to follow the Grateful Dead, and they had decided to take a [LSD] trip in the middle of the night,” Fogerty, 74, tells The Post. “So they were on stage for an awful long time. Therefore, the audience fell asleep, and that’s what we were given to work with.”

CCR barreled through an incendiary one-hour set, rousing the 500,000-strong crowd with soon-to-be classics like “Born on the Bayou,” “Green River,” “Bad Moon Rising” and “Proud Mary.” It’s a moment captured on “Woodstock — Back to the Garden — The Definitive 50th Anniversary Archive,” a 38-CD set that runs over 36 hours, capturing nearly every musical performance as well as stage announcements, like emcee Chip Monck famously intoning in a stentorian voice, “The brown acid that is circulating around us is not, specifically, too good.”

“I really never saw the footage the rest of the world was seeing on TV, at least at that time,” says Fogerty, who hung around to watch Janis Joplin and Sly and the Family Stone before retiring to his hotel before the next day’s CCR show in Camden, New Jersey. “By the time I got home, I would say Woodstock was just kind of put to rest. Even in those days, the news cycle moved on. And then, you know, it got larger as time went by.”

Andy Zax, who produced the box set for Rhino records, began the exhaustive process of assembling the completist collection in 2005.

“There was a certain amount of ambiguity to what we might discover, and that was because in large part nobody had really gone through this material before, and the vast amount of information that there was to draw upon that was out there in the world circa 2005 was either incomplete or just flat-out wrong,” Zax says. “So we were constantly surprised at things that we found, performances that have been made out to be lousy or mediocre or negligible turning out to be amazing. … We found performers that we knew nothing about that had been extraordinary,” he says, adding that folk singer Bert Sommer “is the great lost Woodstock artist, without question.”

Fogerty wrote one of CCR’s most beloved songs, “Who’ll Stop The Rain,” inspired by his impressions of Woodstock.

“I think I had already chosen the metaphor of rain,” Fogerty recalls. “You have to remember, this is the Nixon White House, and the Vietnam War is raging, and I was a young man. I had already completed my military service, but being 24 years old, that whole subject and journey for young men in America was very much on my mind, and also the specter of watching, let’s say, fortunate people, be able to avoid the draft. Kids really mistrusted the government. They mistrusted what they were being told about the war, so I chose to use rain for a metaphor for all that BS, and as I progressed through the song, it seemed fitting to me to touch on Woodstock, because it was momentous and, I don’t want to say sad, but let’s say a kind of fatalism, that we were once again being lied to.

“So in that last verse, talking about, ‘Heard the singers playin’/ How we cheered for more/ The crowd then rushed together/ Tryin’ to keep warm,’ it was kind of a nod toward my generation that at the time was trying to find answers and trying to find warmth or enlightenment in the situation, and while I didn’t quite say it, I was wondering if we were perhaps missing the mark, because here comes the rain again.”

As for the heavy question of the legacy of the Woodstock generation, Fogerty points out that the cohort, later known as the Baby Boomers, “were innocently learning some pretty wonderful ideals,” like respect for elders, working hard for success and helping your fellow man.

‘A lot of these ideas were in our music, the music that we chose to listen to and love back in those days.’

“A lot of these ideas were in our music, the music that we chose to listen to and love back in those days,” he says. “Some of it was folk music, a lot of it was in the rebelliousness of rock and roll, of course. And I think we surprised ourselves. I think Woodstock surprised us. The fact that there were so many people and we saw how powerful we were. I think that was the first time. Wow, there’s a lot of us! Wow, we feel this way, listen to us! And while perhaps those ideals have faltered a little over the years now and then, I think that generation really embraced all those ideals, particularly trying to help your fellow man, what we’d now call civil rights. Those were things we aspired to. I think every kid, at least I sure felt this way, in 1969 was really trying to throw off the trappings of generations before, especially when it came to civil rights, and I think we felt like we really were going to do it. It still takes me by surprise that there’s this much racial bias in this country.”

Fogerty is revisiting that legacy on his “My 50 Year Trip” tour, which will come to Radio City Music Hall on Aug. 15 and the Bethel Woods Center on Aug. 18 — marking the 50th year of the Woodstock festival on its original site. He’ll release a live album, “John Fogerty’s 50 Year Trip: Live at Red Rocks,” on Oct. 25, and is working on a new studio record.

Fogerty was also scheduled to perform at the ill-fated Woodstock 50, initially planned for Watkins Glen, then Merriweather Post Pavilion in Maryland before the plug was pulled on July 31.

“I was happily anticipating the new Woodstock, the 50-year anniversary, at least the one that [original Woodstock co-creator] Michael Lang was putting on. It was also fraught with disorganization, to be kind,” Fogerty says, chuckling. “To me, there’s some closure about that. It’s weird, I didn’t want it to be that way. In the end, I’m playing on the actual site in Bethel, the actual farmer’s field where we played before. It should be great fun, and perhaps I’ll get to embrace the whole thing like I should have 50 years ago.”

Of course, nothing will ever fully replicate the original Woodstock, which is partly defined by its own struggles — like venue changes, horrendous weather, gate crashers and equipment failure.

“People seem to wonder a lot, or at least it’s a question I get, can we do this again? Could this happen again?” says Zax, the producer of the new Woodstock release. “And I think the answer is really kind of a flat ‘no’ because there was something fundamentally unique and non-reproducible and random about the original Woodstock. It’s a thing that could’ve gone wrong in a million different ways, and just by sheer dumb luck and some very hard work by a lot of the very talented people who worked on the production staff and absolutely killed themselves to make this thing happen in a reasonably competent fashion, it didn’t go horribly wrong.

“But it’s not the kind of thing you can plan to do again under any circumstances. In fact, the very idea that it happened once makes it impossible that you could ever do it again. You can’t fake the spontaneity, and Woodstock is all about that in-the-moment-ness.”