Ted and the mother pop champagne on their way to a New Year's Eve party and Ted reminds her of his vow to never get too drunk again. A vow he and the rest of the group made after Barney suffered a world class hangover the day of his wedding.
The group tries to recreate his Stinson Hangover Fixer Elixir to cure him before the wedding. Even more pressing are the family photos he is supposed to pose for in only two hours. The only problem is, Barney is the only one who knows the secret ingredient. While Lily and robin try to revive Barney, Ted and Marshall go out to get the known ingredients to the elixir.
To obtain the last of which, Ted eats an entire tray of bacon. Robin and Lily make out after other attempts to wake Barney fail. Marshall vows to never get that drunk again as do the others over the course of the episode. with each vow, Ted tells the story of how they each broke that vow over the years. When Barney tells them the elixir is a lie, they realize he was just giving them hope when they really needed it.
So to return the favor, they tell him they did Weekend at Barney's for the family photos. The episode ends with Robin trying to get one more kiss from Lily who turns her down.