Copying a Project
Answered
How can I make a copy of an entire project in IntelliJ IDEA? I need to copy a project and rename it.
Also, how can I copy files from one project to another?
Many thanks in advance,
Charles
Please sign in to leave a comment.
You can do it only outside of IDEA using your favorite file manager. Rename can be performed in IDEA after you open the copied project in it.
Serge, many thanks. After I copy the project do I need to do anything special to open it in IntelliJ?
Thanks
No, just File | Open and point to the new location.
Many thanks Serge
When I did this and I had both projects open at the same time, I started getting complete nonsense errors, like
or when I deleted a class from project 1, it started showing errors in project 2 as if the class didn't exist there either. It looks like copying a project folder makes both projects use the same caches and ends up completely corrupting them. Invalidating caches just led to more weird errors. What worked was going into workspace.xml and manually changing the project id.
Can IDEA handle this better?
Chylek Try to remove/rename workspace.xml file in the ".idea" folder under the project's root. This should help.
I already edited it, I'd like to ask if IDEA could work better in this case. Maybe detect that the project folder has changed and use different caches, or detect that two projects are modifying the same caches at the exact same time and ask what to do, rather than silently breaking the caches and ending up with cryptic errors in the editor.
I've never had 100% luck with any solution other than
OR (and this doesn't work every time, and I don't know why):
All - please vote up https://youtrack.jetbrains.com/issue/IDEA-300988
With Eclipse you can use a file manager to copy the project folder to a new location and then open it as a new project. IntelliJ IDEA should be this easy, but it isn't.