Here's how:
Shore up your database primary keys.
CREATE TABLE table2 LIKE table1; //create a new table, copying structure from previous
INSERT INTO table2
SELECT * FROM table1 ORDER BY name; //Copy the data - the Primary key handles the autoincrements
RENAME TABLE table1 TO table1_Backup; //Copy the Old data to a new name as your backup
RENAME TABLE table2 TO table1; //Put the new data in place