I'm all about healthy solutions first. I believe someone mentioned this earlier, but it's worth repeating.
Exercise. Get your heart pumping and your blood flowing.
This was my go to coping mechanism during the acute withdrawal phase.
Not only does it help release endorphins, but it's healthy and will use up excess energy.
It's worth giving it a shot before trying to fix a symptom with another drug.
Also, a strict routine and structure every day was key for me. As well as hydrating and eating healthy. That combined with exercise, I can't describe, was better than the drug itself those first couple weeks.
Spotify, good headphones, good music and a long walk or run = gold. By 10 minutes, the endorphins are flowing, and it was as close to a drug high as I could obtain - and it was healthy to boot!
I was so exhausted by 10 PM every night, I slept like a baby for 8 straight, uninterrupted hours of good, restful, healing sleep.