It is to close the short-term contract that is about to expire and establish the same position in the long-term contract as before.
Risks mainly include:
For example, if a factory does selling hedging, it will worry that the closing price of the recent contract will be higher and the opening price of the forward contract will be lower.
Buying a hedge is the opposite.