They never used fixed id's. The icons are alphabetically sorted by their texture name.
The same goes for macro's themselves.
Their index is determined based on the sorting by name, so if you rename a macro from "zzz" to "aaa" for example then it will have a completely new index value.
The simplest way to get the texturename is to use /dump GetMacroInfo(name) ingame and note down the texturename