Ah, with an undergravel filter, the media is the gravel. In this case you can't put the old media in the new filter. You said earlier that you want to change the substrate - in other words you want to take out all the old media.
This does make it trickier. Running the new filter in the tank won't grow any more bacteria that you already have. Most of them will stay in the gravel. Adding bottled bacteria won't grow any more bacteria - the amount of bacteria you already have is the maximum the tank can support.
All I can suggest is that you set up a container, the larger the better, and run the new filter in that. Add a bacterial starter and ammonia, and follow this method
Cycling Your First Fresh Water Tank What is Cycling and Why is it Important? Fish waste, and especially fish breathing, plus uneaten food and other organic matter breaking down in a tank all produce Ammonia. This can quickly become toxic to fish if it is allowed to build up to any measurable...
www.fishforums.net
Once the new filter is cycled, remove the fish from the tank and put them in the container with the filter while you change the substrate (do you intend removing the undergravel filter as well?)
You have also mentioned plants - if you intend fast growing plants these will help as live plants take up ammonia and they don't turn it into nitrite - floating plants are best for this.
Once you have the new substrate and plants in the tank, put the fish back in and the new filter. Keep an eye on ammonia and nitrite until you are sure they remain at zero - if they do read over zero, a water change will get them back down.