Yes, it is a coping mechanism. If you are truly wishing to replace it with an equivalent coping mechanism, you are going to be able to do that.
Trauma can make you want to numb, or if numb want to feel real. SIB is often used for those reasons.
Self harming behavior works either way because of the mind-set one falls into while doing the behavior. Since you (as others) already have that control, it is possible to find that mind-set without the injurious behavior. Try to recreate the feelings and thoughts you get when you accomplish the task, and link them to something else that is non-harming. Using a marble to roll between your fingers as a self calming coping mechanism works for many, but find something that is relevant for you.
Some have begun to withdraw from the harming aspect by using a bold red marker, or writing on themselves instead, for instance for cutting.
Good wishes.