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
0
9 comments

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).

3
Avatar
Sebastian Lauffer

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
Avatar
Sebastian Lauffer

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

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

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

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

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

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

If this makes it into a feature request

Developers almost never read forums. If you'd like to submit a feature request please submit one at https://youtrack.jetbrains.com/newIssue
 
 
Back to the problem: if you want to move project using IDE you can right click a project root > Refactor > Move.
 
If the change was external - then you would have to play around with /.idea folders.
 
 

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.

All temporary run/debug configurations are kept in /.idea/workspace.xml file, all saved run/debug configurations are stored in /.idea/runConfigurations/ files.
 
0

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

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.