How to rename / move a project in Intellij Idea 12?

54,981

Solution 1

It seems that one has to right click on the project (after following the instructions to rename the Project), then choose Refactor -> Move to relocate project to the new location. I didn't find any solution to rename and move a project at once.

Solution 2

  1. Right click on project, then Refactor -> Rename... (shift+F6), set desired name
  2. Close IntelliJ
  3. Rename directory in your filesystem to your desired name
  4. In startup dialog select Open (or File -> Open... in main window)
  5. Please select renamed project directory

Enjoy, it work's for me!

Solution 3

  1. Close IntelliJ
  2. Rename the folder in Explorer (Windows) / Finder (OSX)
  3. Open IntelliJ
  4. Import Project from Dialog, or File -> Import Project
  5. Select the folder with the new name
  6. Follow the dialogues

Solution 4

  1. Go to File then Project Structure
  2. Under Project Settings -> Project make sure that you change the project name.
  3. Then under Project Settings -> Modules change the name there as well.
  4. Restart Intellij
  5. Use your File Explorer to confirm that the project/modules have been renamed.

Solution 5

If it is a gradle project, instead of renaming it using Refactor->Rename :

  • set the rootProject.name variable in the settings.gradle file to the new project name.
  • reimport the project. Hit the 'Refresh all Gradle Projects' button in the Gradle Tool Window.

Then follow steps 2 to 5 in @Dawid's answer.

To remove the old project from IntelliJ's list of managed projects:

  • select File->Open Recent->Manage Projects..
  • click the 'x' next to the old project name
Share:
54,981
sheidaei
Author by

sheidaei

shahin.sheidaei.com

Updated on July 09, 2022

Comments

  • sheidaei
    sheidaei 6 months

    As stated here one can change the name of a project. However, it only changes the name of the project and it will not change the folder structure.

    As an example if your project is called sample1 and it resides ~/user1/development/IdeaProjects/sample1, the folder location won't be changed to ~/user1/development/IdeaProjects/sample2 if one changes the project name to sample2.

  • Adam Toth about 8 years
    It doesn't rename the project folder only moves it. So ultimately you probably have to do that manually
  • null
    null almost 8 years
    Answering with shortcut key is a bad answer as everyone can change the keymap.
  • bolec_kolec
    bolec_kolec almost 7 years
    This doesn't help. It doesn't change of the project folder. Instead of this it creates a new one with a new name and moves there. The old folder of the project folder is inside a new one.
  • Demian over 6 years
    Does not work, all the module settings get reimported with Intellij best guesses
  • Tomáš Záluský
    Tomáš Záluský over 5 years
    Works for me in Idea 2017.1, just beware: (1) moving might be slow (I waited for approx. 15m for 471MB project with 16000+ files), (2) for one project, new git root was not detected (but it's easy to correct in Version Control Settings)
  • z33k
    z33k almost 5 years
    It works...in a way. I mean this workaround let's you refactor both the IntelliJ metainfo and the folder structure on disk, but it doesn't address anything that probably stays in the main user configuration folder (~/.IdeaIC2017.3 in my case). So anyone going with this solution is bound to be haunted by some ghost projects in some IntelliJ dialogues later
  • stephanmg
    stephanmg almost 3 years
    The common sense answer. I think we should upvote this. (IJ 2019.3 Community)