Change Native Parent Class(Path) of Widget

Hello everyone,
how can i change the Native Parent Class of a Widget?
I created some Widgets in one Project and want to Migrate them to another. Migrating the Widgets itself is not a Problem, however they still search for their C++ Parent Class in the Old Location.
Widget in Old Project:

Migrated Widget in New Project:

I copied the Old C++ classes into the new Project and got them Setup Properly, i can create new Widgets out of those C++ classes. However i can’t find a way to tell my Migrated Widgets that their Parent Class is not under “OldProject/ParentClass” but now under “NewProject/ParentClass”.

Am i missing something?

I can`t open the Widget to reparent it from the Designer btw, i get following message when trying to open:

Widget Blueprint could not be loaded because it derives from an invalid class.
Check to make sure the parent class for this blueprint hasn’t been removed!

Load Errors:

I tried to change the DefaultEngine.ini, but no succes so far. Maybe theres a variation i missed?

[/Script/Engine.Engine]
bSubtitlesEnabled=False
+ClassRedirects=(OldName=“MainMenu”, NewName="/Script/CoopGame.MainMenu")
+ClassRedirects=(OldName=“PuzzlePlatforms.MainMenu”, NewName="/Script/CoopGame.MainMenu")
+ClassRedirects=(OldName="/Script/PuzzlePlatforms.MainMenu", NewName="/Script/CoopGame.MainMenu")
+ClassRedirects=(OldName="/Script/PuzzlePlatforms", NewName="/Script/CoopGame")
+ActiveClassRedirects=(ObjectName=,OldClassName=“PuzzlePlatforms.MainMenu”,NewClassName=“MainMenu”)
+PackageRedirects=(OldName="/Script/PuzzlePlatforms",NewName="/Script/CoopGame")

If you didn’t realize yet, code in UE4 is devided in to modules which are compiled in to dlls and you can have few of them, All modules are the same regardless if they are in game project, plugin or engine code it self, they operate under same conditions only difference is how they are distributed, in your case your module is in game project. You need to understand that to understand your issue

The issue is that your module name changed without your project name, changing asset pathing and messing up depency information of your blueprints. I don’t know how the name is significent for you and what you got in old project for you but quickest fix for this is to copy module (PuzzlePlatforms) from old project without changing it name and add in to uproject module list and regenerate VS project files, also remove code form PuzzlePlatfroms from CoopGame so you won’t have name colisions between modules. This should make blueprints workable again. If you don’t have PuzzlePlatfroms from old project that means oyu will need to changem odule name manually and this require renaming files and change CoopGame to PuzzlePlatfroms in them, you cna seperate code to module with name PuzzlePlatfroms too.

Now once you got to this point if you want to move those classes back to CoopGame it tricky. I don’t know what you got in those blueprints, but you could create similary named classes in CoopGame and then reparent the class and remove PuzzlePlatfroms module once you done, fix any bugged nodes you will have there.

You could try to skip all that by reparenttng those blueprints in old project and then copy them to nre project, again i don’t knwo what your bluepritns have and how they are tied to project.

If you plan to reuse native code between projects maybe try making it a plugin or atleast put it in to module with common name that won’t change when you move between project, this will avoid a lot of troubles like that.

Thanks for the long answer! I already tried to copy the PuzzlePlatform Module to the new Project, but somehow, even after regenerating vs files, it wouldnt show up under C++ classes in the ue editor.
By now i just created new Widgets from the new MainMenu class in the CoopGame Module and then copied the Widget Canvas over to the new Widget. Didnt know u could just copy so much Information over from one Open Editor to another one.
Still i marked your’s as an answer, maybe it helps someone else.