The answer is Yes, it's possible to import your project basically created with G071R8 on G071RB using CubeMX.
I present to you, as mentioned in the image below, a ways which allows you to know the MCUs that are compatible with each other even with different Flash sizes and all this through CubeMX =) :
Yes, one possibility is to edit the CubeMX project file IOC: open it using your favority text editor and find/replace all occurences of STM32G071R8 with STM32G071RB (about 2..3). Load that project in CubeMX again and enjoy the same pin and other settings as before.
But please be careful: this will only work properly if a device is replaced with the same type with less or more memory.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Good luck!
/Peter
In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
The answer is Yes, it's possible to import your project basically created with G071R8 on G071RB using CubeMX.
I present to you, as mentioned in the image below, a ways which allows you to know the MCUs that are compatible with each other even with different Flash sizes and all this through CubeMX =) :