If the county designated in the complaint is not the proper county, the action may notwithstanding be tried therein unless, within 20 days after the summons is served, the defendant demands in writing that it be tried in the proper county. This demand shall be accompanied by the affidavit of the defendant, or defendant's agent or attorney, setting forth the county of residence at the time of the commencement of the action, the date of service of the summons, and stating that neither the cause of action nor any part thereof arose in the county designated in the complaint. This demand and affidavit, with proof of service thereof upon the plaintiff's attorney, shall be filed with the court administrator in the county where the action was begun within 30 days from the date of its service and thereupon, unless the county where the action was begun is a county in which the cause of action or some part thereof arose, the place of trial shall be changed to the county where the defendant resides without any other proceedings. If the county designated in the complaint is not the county in which the cause of action or some part thereof arose and if there are several defendants residing in different counties, the trial shall be had in the county upon which a majority of them unite in demanding or, if the numbers be equal, in that whose county seat is nearest. When the place of trial is changed all other proceedings shall be had in the county to which the change is made, unless otherwise provided by consent of parties filed with the court administrator or by order of the court and the papers shall be transferred and filed accordingly. When a demand for a change of the place of trial is made as herein provided the action shall not for any of the reasons specified in section 542.11 be retained for trial in the county where begun, but can be tried therein only upon removal thereto from the proper county in the cases provided by law.
A party who has paid the filing fee of the county where the action originated shall not be required to pay the filing fee of the county to which the action is transferred. The transferor county may retain any filing fees received prior to the change of county, but shall in writing advise the county to which the action is transferred of any and all such filing fees paid to the transferor county.