I recently asked a question on ask ubuntu(main site) which was migrated to ask ubuntu(meta). Can anyone tell me how it happens.
I think you're referring to this one: To work with older account.
In general a question is migrated if:
- A moderator / Stack Exchange employee migrates it;
- Five users vote to migrate it using the "close" link under the question, which currently you can see only under your own questions (you won't be able to see it under others' questions until you'll have gained the view close votes privilege, awarded at 250 reputation).
In this case, as you can see from the question's revision history, five users voted to migrate it.