How can I rename a plugin and not break all blueprints?

Hello,

I’m trying to refactor some code and decided it might be a good idea to rename one of my plugins. I then quickly realized its not straight forward as every blueprint references its classes by name including the plugin name it seems.

I tried adding an active class redirect to DefaultEngine.ini in [/Script/Engine.Engine] as follows (an example) without luck:
+ActiveClassRedirects=(OldClassName=”MyPluginManager”,NewClassName=”/Script/NewPluginName.MyPluginManager”)

I’ve also tried various variations of the above. Is there an easy way to do this? or am I stuck with the old name?

Thanks!

1 Like

;+ActiveClassRedirects=(OldClassName=“CaptureBinder”,NewClassName=“/Script/Capture.CaptureBinder”); Class moved to Plugin (Capture is the Module name, not the Plugin name)
I found out the package path by creating a new blueprint from the moved class and looking into the blueprint file with an text editor.

I’ve solved it by using core redirects inside the DefaultEngine.ini

https://docs.unrealengine.com/en-us/Programming/Assets/CoreRedirects

[CoreRedirects]
+PackageRedirects=(OldName="/OldPluginName/", NewName="/NewPluginName/", MatchSubstring=true)

Afterwards, you should make sure to resave all assets by right clicking on the plugin content folder and selecting Resave all.

Then make sure to remove that line again from the DefaultEngine.ini!

3 Likes

I found I also had to add these redirectors to the [CoreRedirects] section

+ClassRedirects=(OldName="/Script/OldPluginName.",NewName="/Script/NewPluginName.",MatchSubstring=true)
+StructRedirects=(OldName="/Script/OldPluginName.",NewName="/Script/NewPluginName.",MatchSubstring=true)
1 Like

This format worked for me. There are so many different ways of specifying OldName and NewName that just don’t work (at least in UE5.1). Even the official docs had it wrong.

What if I want to move the class from the plugin to Game’s Source class? How do I redirect that?

Now:

[CoreRedirects]
+PackageRedirects=(OldName=“/OldPluginName”, NewName=“/NewPluginName”, MatchSubstring=true)

Don’t add a slash to the end, it won’t work.

Just in case, I will also say that this line should be in the .ini located in the plugin, not in the project. For example: DefaultYouPluginName.ini

2 Likes

You can also check out the article by the team that faced this problem to develop a demo version of the GLS plugin.