HowTo change completely the project folder

HowTo change project folder?

What about this steps (all from project view):

1. move foder (F6)
2. rename directory (shift+F6)

but

  • i saw that .idea folder was not moved. and when i delete it it comes again. so i could not delete. ?:|
  • old folder name is always visible in project view (third colname) ?:|


Attachment(s):
Create New Project_2012-08-07_17-52-47.png
9 comments
Comment actions Permalink

Hi Sebastian,

Since you have not provided enough details ("real" folder names example), I can offer you few such possible approaches:

1. To move project from "Z:\projects\mysite.com\www" to "Z:\projects\mysite.com"

  • Close that project in PhpStorm
  • Delete existing .idea folder (where project settings are stored): "Z:\projects\mysite.com\www\.idea"
  • In PhpStorm, use "File | Open Directory..." and point to the new location ("Z:\projects\mysite.com")
  • That's it -- start configuring new project


Yes, you could copy .idea into new location as well ("Z:\projects\mysite.com\www\.idea" --> "Z:\projects\mysite.com\.idea"), but then you will need to edit (and maybe delete) some config files there to get rid references to the old location (they are simple XML files and there are not many references to edit, so there should be no problem doing that .. but I don't really see much point of doing that -- new project will be safer to do)


2. Another possible approach works differently (really depends on what you want to achieve):

  • In PhpStorm, open that project
  • go to "Settings | Directories"
  • remove unwanted Content Root
  • add new proper location where your project files are now located.


This will leave all settings in tact, but project files will now be taken from different location (could even be different drive).

1
Comment actions Permalink

thanks i will make notice of this.

BTW if you have fun for take a video (not yet your suggestion) for the problem you could use this:

http://www.youtube.com/watch?v=KiE7wRm5YmM

0
Comment actions Permalink

BTW usuallly when i create a project i start with timestamp as projectname.

everything is growing as prototype. and then i refacoring all. step by step.

fast moving projects around seems not suported at such IDEs. probably its the same in eclipse (how its called there? workspace or so)

0
Comment actions Permalink

I think this is a feature request (and surprised it is not available). Manage Projects does exist; but doesn't do much. Suggestion above to simply delete project and do it over again could certainly be made simpler.

Obviously the correct approach should be to manage projects -> pick project in question -> edit project details (like base folder).

0
Comment actions Permalink

Suggestion above to simply delete project and do it over again could certainly be made simpler.

Since then, it became much easier: 1) close the project 2) move it with your file commander 3) open it from the new location in PhpStorm. The settings use relative paths now.

Obviously the correct approach should be to manage projects -> pick project in question -> edit project details (like base folder).

I haven't really worked much with software operating with project, but if you look at virtual machines software (VirtualBox, VMware), none of them offer that kind of management.

If you feel it'd get a decent amount of votes, please submit a feature request: https://youtrack.jetbrains.com/newIssue?project=IDEA

0
Comment actions Permalink

Here's my experience with it just now:

  • I had my PHPStorm Project pointing deep into our monolithic repo, down to just the root Drupal codebase folder.
  • Project lead moved the location of this folder within the repo to restructure things a bit.
  • Git pull restructured my folders, and PHPStorm "looked empty."
  • Following the suggestion in this thread, I closed PHPStorm and copied old project root physical folder `./.idea` to new desired physical root.
  • I opened this new physical folder in PHPStorm, and it picked right up again.

The reason "simply starting a new project root" is not a suitable solution is _all_ the workspace config travels with the ./.idea/workspace.xml file: Everything from recent search conveniences to complex phpunit test configurations.  Moving (or copying) ./.idea retains all this goodness.

If this makes it into a feature request, please consider all the use cases of "moving project root" including this retroactive move scenario.

Cheers
-Bronius

[edit] I spoke way too soon.  I don't think any of my docker test server config was retained :( and I'm not sure how to get it back in order again without starting over with phpunit config. [/edit]

0
Comment actions Permalink

Project lead moved the location of this folder within the repo to restructure things a bit.

0
Comment actions Permalink

Thanks for your reply, Dmitry:

> How was it moved? Like C:/drupal to D:/webroot/drupal? Or C:/1/2/3/drupal to C:/1/drupal?

The change was in the repo, so as soon as I pulled, the shift occurred.  It was a change like:

`[repo_root]/packages/drupal` to `[repo_root]/drupal/subfolder`, where `drupal` in the original and `subfolder` in the second are direct parent to "Drupal web root" respectively (so, like `./packages/drupal/web` and `./drupal/subfolder/web`).

I was able to recover the `.idea` hidden folder from MacOS TimeMachine, which, thankfully, just as some other forum suggested it would, it had project-space-relative paths instead of its original hardcoded absolute paths, nonetheless, for whatever reason it only retained my phpunit test definitions, not the test machine configs.  Or if it did, maybe it removed them, having found them invalid..

At any rate, no worries, I've re-created the test host definition(s) and moved on since then.

0
Comment actions Permalink

Thanks! Glad this is alright now. Let us know if you would need assistance with something else.

0

Please sign in to leave a comment.