You might not need a new track; you might just need to replace the pin atop the door that slides along the track. I did just that last month: I used a 3/8” dowel and everything works fine.
That door has been a problem since I bought the house. The track is probably like 66 years old. As the door slides down the track, the wheel rotates inside the track and is changing the height of the pin sticking up until it's too low to stay within the track and falls out. I had precariously balanced the door within the track when I had to leave for an appointment this morning. When I returned, I saw that my very large Maine Coon cat had pushed the door out of its precarious position and it was laying crooked. Got to fix that! The track is about 49" long. I have to see if HD has tracks that long.