How are you trying to do it? There should be several migrations:
1) A schema migration to add the new foreign key, which should be
nullable at this point
2) A data migration to move the old data into the new column
3) A schema migration to drop the nullability of the new foreign key
4) A schema migration to drop the old foreign key
You may not need as many migrations if you do not need to migrate the
old data over, or if the new foreign key is allowed to be null.
Cheers
Tom