The 23-year-old was released by the Oakwell outfit at the end of last season, having netted 12 goals in 41 appearances while on loan at League Two last season at Walsall.
Miller came through the ranks at Bury, scoring 16 goals in 51 appearances following his debut at 18.
He was snapped up by Boro in 2017, with loan moves to Wrexham, Bury and Bradford City following during his time at the Riverside.
Barnsley paid £200,000 for his services in January 2019, but he struggled for game time with the Reds.
Further loans at Bradford, Scunthorpe United and Walsall followed.
Miller said: "I’m buzzing, I’ve got settled in nicely and already had chance to meet players and staff which has been great.
"Every week I’ll give it everything, I’ll run my socks off for the team and hopefully top it off with some goals as well."
Miller is the club's second signing of the summer following the earlier capture of former Fleetwood midfielder Harrison Biggins.