I do not know how to do this automatically with full accuracy, but these are the steps that I perform manually when I need to rename Phoenix projects.
The commands below assume that your code is in the git repository and the old application is my_app / MyApp and the new one is my_new_app / MyNewApp . The process is fragile - if your application or module name can be found in many places (for example, this is one letter A or something else), then this will not work.
# search replace both the application name and module name in all files indexed by git $ git ls-files -z | xargs -0 perl -p -i -e 's/my_app/my_new_app/g; s/MyApp/MyNewApp/g;'
After that, I run mix test and fix any compilation errors or testing errors.
Finally, I will quickly look through git diff to make sure everything looks right.
source share