In 2010, Indian railways switched from a four-digit numbering system to five digits.
They were running out of train numbers.
Indian railways today operates 13,000 trains daily.
There is a PDF that talks about the problem, the solution, exceptions, and a rollout plan.
One fine day, IT systems seamlessly transitioned—-took some time to wipe the old numbers from passengers memories.