Within twenty-one days after the conviction of a sex offense, upon the motion of the district attorney, the defendant, or the court, the court shall commence proceedings under this part 9 by ordering the district attorney to prepare a notice of the commencement of proceedings and to serve that notice upon the defendant personally.