Hello @VGoya ,
Currently STM32CubeIDE doesn't support the feature to switch project from one MCU to another.
You can generate your project with STM32CubeMX as a stand alone tool and select STM32CubeIDE as target IDE.
For more details, please have a look at this article: MCU1 to MCU2 migration option within STM32CubeIDE.
Hope that I've answered your question.
If this the case, please close this post by clicking the "Select as Best" button on my reply. This will help other members of the community find this response more quickly :)
Imen
In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks