Generally, I believe that the jurisdiction in custody matters would be with the state where the child has lived with a parent for the past 6 months. So if a parent with the child moved to another state more than 6 months ago, I believe the state where they are now residing would have jurisdiction, no matter what state the original custody order is from.
This can get so complicated that in many cases the advice of an attorney is usually best. One issue is that the current order may state that the custodial parent can not move to another state with the child without the court's permission. And then you have joint custody arrangements.