I'm moving a large forum database from MSSQL to MySQL, converting to the new forum format with a php script, but in order to make sure I can keep my users attached to their posts, PMs and various other things in the database, I'd like to be able to bring in their ID from MSSQL rather than have MySQL autonumber the ID. In MSSQL this was Enable Identity Insert, but I can't seem to find an equivalent for MySQL.
I suspect it can do this, I'm just not seeing the wood for the trees ;)
Migrate your MSSQL table(s) data to simple temporary MySQL table(s) without identity. Now create an empty MySQL table(s) with auto_increment identity column definition that matches with data that came in from MSSQL.
Now, simply do an INSERT INTO <id_col_table> SELECT * FROM <non_id_col_table> within MySQL itself and drop the simple temporary table(s). This is required since there is no IDENTITY_INSERT in MySQL like MSSQL and one cannot add a auto_increment identity column with an alter table.
Now, simply do an INSERT INTO <id_col_table> SELECT * FROM <non_id_col_table> within MySQL itself and drop the simple temporary table(s). This is required since there is no IDENTITY_INSERT in MySQL like MSSQL and one cannot add a auto_increment identity column with an alter table.