How can I clone a whole project in IntelliJ Idea?

Using your operating system File Explorer tool, just copy and paste the entire project directory somewhere new. All of the configuration should use relative paths by default.

If your IDEA project is .ipr based, then delete the new .iws file before opening the project. If your IDEA project is .idea directory based, then delete the workspace.xml file before opening the project.


If you want to copy and rename the project too, like I wanted to clone a project in order to use it with a newer version of IntelliJ.

  1. Copy the whole directory to a new location, for example on Linux:

    cp -r myproject new/location/

  2. To rename the project:

    2.1. rename the project folder (e.g. mv myproject newproject)

    2.2. get into the new project folder (e.g. cd newproject) and edit the .name file with a text editor.

Open the new project now in IntelliJ (you may want to remove the workspace.xml if you don't want to keep the open file history - I kept it) and enjoy your new project!