Suppose that G and H are magmas and that R is a strongly G-graded ring. We show that there is a bijection between the set of good (zero) H-gradings of R and the set of (zero) magma homomorphisms from G to H. Thereby we generalize a result by Dascalescu, Ion, Nastasescu and Rios Montes from group gradings of matrix rings to strongly magma graded rings. We also show that there is an isomorphism between the preordered set of good (zero) H-filters on R and the preordered set of (zero) submagmas of G \times H. These results are applied to category graded rings and, in particular, to the case when G and H are groupoids. In the latter case, we use this bijection to determine the cardinality of the set of good H-gradings on R.