There is no trick to it, but there are certain conditions like, there should be vacant berths in upper class and ticket availability should be in Waiting List in lower class and also the passenger should be full fare paying passenger. Though the upgradation happens, it is rare during peak/vacation season and in high demand trains.