After joining Adelaide in January, Griffiths struggled to cement a place in the line-up after issues with shin soreness and then a bout of concussion. He played four games for the Reds - all as a substitute - and scored once.
The 32 year-old will join Sarawak this week after a deal was agreed over the weekend.
"It was a difficult decision to release Ryan as it's not a great time to lose a player with only five games remaining and still competing to make the finals, particularly now we are outside of the transfer window period," Adelaide football director Michael Petrillo said.
"However he received a very good two year offer from Sarawak and we were not in a position right now to offer him a contract extension due to his lack of recent game time.
"Therefore the club didn’t want to stand in his way and we were able to quickly negotiate a transfer agreement with Sarawak that we were all comfortable with."