This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 436578 - [server] Renaming the install directory breaks all the workspaces
Summary: [server] Renaming the install directory breaks all the workspaces
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Server (show other bugs)
Version: 5.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 7.0   Edit
Assignee: Anthony Hunter CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 439732
Blocks:
  Show dependency tree
 
Reported: 2014-06-04 09:11 EDT by Ethan Groves CLA
Modified: 2014-09-02 12:01 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ethan Groves CLA 2014-06-04 09:11:39 EDT
To reproduce:
1. download and install orion 5.0 (eclipse-orion-5.0-macosx.cocoa.x86_64.zip in my case)
2. unzip it.  by default it creates a folder called 'eclipse'
2. launch it, create a project, and add some files
3. close it
4. rename the 'eclipse' folder to something else, like 'orion'
5. launch it again and note that the files under your newly created project are gone
Comment 1 Mark Macdonald CLA 2014-06-04 09:53:04 EDT
It seems the server stores the ContentLocation for each project as an absolute path:
> // my%20project.json
> { "ContentLocation": "file:/C:/Users/mamacdon/orion/eclipse/serverworkspace/aa/aaa/OrionContent1/my%20project",

If the server workspace ever gets moved or renamed, all these paths will be wrong.
Comment 2 Anthony Hunter CLA 2014-06-04 12:58:33 EDT
Yes, we have hit this before. It is redundant to store a ContentLocation for a project in the default location, so we should fix this.
Comment 3 Anthony Hunter CLA 2014-07-31 11:43:26 EDT
(In reply to Mark Macdonald from comment #1)
> It seems the server stores the ContentLocation for each project as an
> absolute path:
> > // my%20project.json
> > { "ContentLocation": "file:/C:/Users/mamacdon/orion/eclipse/serverworkspace/aa/aaa/OrionContent1/my%20project",
> 
> If the server workspace ever gets moved or renamed, all these paths will be
> wrong.

I plan to fix this with the work in Bug 439732.
Comment 4 Anthony Hunter CLA 2014-08-20 13:59:39 EDT
I plan to replace inside the currently stored metadata:
"ContentLocation": "file:/C:/Users/mamacdon/orion/eclipse/serverworkspace/aa/aaa/OrionContent1/my%20project"

with 

"ContentLocation": "${SERVERWORKSPACE}/aa/aaa/OrionContent1/my%20project"

In this case the serverworkspace folder is C:/Users/mamacdon/orion/eclipse/serverworkspace. (i.e. so the serverworkspace folder is replaced with ${SERVERWORKSPACE})

This will simply be an operation that is done when reading and writing the metadata (JSON) files. The server will still make use of the existing ProjectInfo API which provides URI getContentLocation() and IFileStore getProjectStore().

If you see any issues with this let me know.
Comment 5 Anthony Hunter CLA 2014-08-20 16:09:00 EDT
The changes were delivered into branch ah-Bug439732 with commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=88ba908d61967c245f8fc8915044f2854798793e

Will mark resolved once Bug 439732 gets pushed.
Comment 6 Anthony Hunter CLA 2014-09-02 12:01:49 EDT
(In reply to Anthony Hunter from comment #5)
> The changes were delivered into branch ah-Bug439732 with commit:
> http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/
> ?id=88ba908d61967c245f8fc8915044f2854798793e
> 
> Will mark resolved once Bug 439732 gets pushed.

I am pushing the branch to master