i would have said the only way would be to transfer to another tank, but you can do the substrate change with the fish in there, depends what you want to put in, and i would have said algae was about your balancing,
sorry if i was no help
if you dont have another tank or suitable container for the fish the best thing to do is buy a few cheap buckets and place the fish in them, they will need a heater though and possibly an airpump to circulate the water a bit. depending on how long it takes you (it always takes longer than expected) then water changes may be required to keep ammonia levels down.
if you are getting algae trouble then it will without a doubt return without getting to the cause. is the tank in direct sunlight? how much are you feeding the fish and how often? there are many types of algae and reasons for its existance.
how often do you change water in the tank? also gravel/sand vac?
your filter will need looking after too while this is going on so make sure its fully submerged in tank water until ready to be put back in the new set up. if the filter doesnt fit in a bucket then remove any media/sponges and place them in one of the buckets containing the fish
Hi there - I had the same problem when I was upgrading to a larger tank.
I bought a huge cheap plastic tub from the local hardware store (Homebase if you are in the UK) filled it up with the water from the tank put in the heater & filter up and running (therefore didnt need an air pump) and all the fish. Then when you have the new tank the way you want it put as much as the tank water that you can back in an top up with fresh to the top. Then just put your fish back. You should be able to do it all in a day. Make sure you wash the new gravel really well as it can cloud up the water and you really want to put the fish back asap and just keep an eye on your water stats for a few days - all should be well.