After some more research on the Internet I can only conclude that my first thought was right: it must be a form of Greek Sophia "wisdom", but here used as a surname.
Zofiya can also be written as Sofiya. It is stated to be an Asian first name for girls. But it is also the early english pronounciation of Sophia, like Maria = ma-RY-a, or EYE-ris instead of eer-REEZ for Iris. I also found Zofiya to be a Turkish form of Zophia and somewhere else I found the theory that it is a Russian form.
So: this doesn't help you much to find out from which country your grandparents could originate. Also because I only found Zofiya used as a first name, not as a surname.
It might be possible that the surname comes from the name of a town or city, called Zofiya (also a form of Greek Sophia). I did not find a placename with this exact spelling. So I guess it will be almost impossible to find out where you can start looking. You will have to try to fing other kinds of clues that will help you further.