What is the meaning of Once_upon_a_time?

A long time ago; at some time in the past (a traditional beginning of children's stories, especially fairy tales).

formerly

Source: wiktionary.org