I'm Lucy, and I'd be happy to answer your questions today.
The age of majority in both Missouri and Illinois is 18. A child does not have an absolute legal right to choose where to live until their 18th birthday. If you have an existing court order that gives the mother primary custody, it has to be changed, or you could be held in contempt of court. This is true even though your daughter wants to live with you - court orders have to be followed until they're changed. The mother could actually have you charged with child abduction if you kept your daughter in violation of an existing court order. 720 ILCS 5/10-5.
Now, because your daughter is 17, when you go back to court, there's a high probability the judge will rule in your favor, so the other option is to see if the mother will agree to let your daughter move in with you to save everyone the trouble of going back to court. If you can get that agreement - even in a text or an email - that would be enough to protect you if the mother changes her mind later. The motion to modify would need to be entered in whichever state entered the original court order.
If there isn't a court order, you have to get one, or you could still be charged under the above statute. Child abduction applies to all minors under the age of 18, even if they go willingly with a non-custodial parent.
If you have any questions or concerns about my response, please reply WITHOUT RATING. It's important that you are 100% satisfied with my courtesy and professionalism. Otherwise, please rate my service positively so I am paid for the time I spend answering questions. If you are on a mobile device, you may need to scroll to the right. There is no charge for follow-up questions. Thank you.