A court may, on the petition of the accused and for good cause shown, order the venue of the trial of a criminal case in such court to be removed to some other county. When the venue is so changed, the court making the order shall recognize the witnesses and the accused (if the offense be bailable and bail be given) to appear on some certain day before the court to which the case is removed; if the offense be not bailable, or the bail required be not given, the court shall remand him to its own jail, and order its officer to remove him thence to the jail of the court to which the case is so removed, so that he shall be there before the day for the appearance of the witnesses. The clerk of the court that orders a change of venue shall certify copies of such recognizance, and of the record of the case, to the clerk of the court to which the case is removed; and such court shall proceed with the case as if the prosecution had been originally therein, and for that purpose the certified copies aforesaid shall be sufficient.