Weir has 21 international caps to his name but has had found opportunities for club and country harder to come by since the impressive rise of fellow Warriors stand-off Finn Russell.
And the 24-year-old has agreed to make the switch to BT Murrayfield this summer.
"It was a very difficult decision to leave Glasgow Warriors, a club I've supported since I was a teenager," he told the Warriors website.
"It'll be a new challenge for me at BT Murrayfield after six years at the Warriors and when the time comes I'll move on with a number of good memories from my time in Glasgow.
"The highlight has obviously been winning the GUINNESS PRO12 last season, but there is still a lot of rugby to be played this season and my aim is to end my time at Scotstoun on a high."
Glasgow head coach Gregor Townsend said: "Duncan has been outstanding for us over the last few years.
"He's had to go through some tough times with injuries, but he always brings enthusiasm to training and he's playing some really good rugby.
"It'll be tough for us to go up against him next season, but he wants to fight for the stand-off position at Edinburgh Rugby and we wish him all the best when he leaves."
To buy tickets for the GUINNESS PRO12 Grand Final click here. Also follow us on Facebook, join the conversation on Twitter, sign up to our YouTube channel for extensive match highlights and sign up for our newsletter for regular updates on the GUINNESS PRO12.