Moving Confluence Home to another drive
Asked by Espen B?rrud:

I have been running Confluence 5.2.3 in production for a couple of months, and the Confluence Home directory is currently located on C:\\Program Files (x86)\\Atlassian\\Application. Data\\Confluence.

My server-guy would prefer that I change the Home Directory to another drive (D:), to keep C: free of data storage and databases. I wonder if there is an easy way to accomplish this?

Is there a way to change the home directory post installation, or do I have to take a backup, uninstall current instance, reinnstall confluence with home dir on D:, and then import all data from backup?

If there is a way, I would appreciate a tutorial for how to go ahead with this. In advance, thanx.


Answers:
author: Nic Brough -Adaptavist-
body: Stop Confluence, COPY the home directory wholesale to the new place, reconfigure Confluence to use the new home directory, and then restart it. Obviously, you should always backup before doing this.

One question though. Most of your data is actually in the database, and you don't mention where that is. Hopefully you won't have to do anything about that, but you do need to think about it, even if it's just to say "it's safe"

comments: author: Espen B?rrud
body: Thanks Nic. My data is located in an external MySQL db. My follow up question would be regarding "reconfigure confluence to use the new home directory". How do I do this?


author: Nic Brough -Adaptavist-
body: Ah, that's good, as it's separate, you don't need to worry about it (ok, "always take a backup" still applies...)

To change the home directory, you should be able to edit the file confluence-init.properties and restart it. More at <https://confluence.atlassian.com/display/DOC/Confluence+Home+Directory>


author: Espen B?rrud
body: I tried this approach, by doing the following:

1. Stopped Confluence

2. Copied the content of C:\\Program Files (x86)\\Atlassian\\Application. Data\\Confluence, to D:\\ConfluenceData

3. Edited the confluence-init.properties

4. Renamed the "old home-" confluence-folder (just in case)

5. Restarted Confluence

Trying to access confluence in my browser, promted me for an "installation key". I did not want to go down that path. When I took a look in my filesystem, there was a new confluence-folder generated in my original home directory C:\\Program Files (x86)\\Atlassian\\Application. Data\\, beside the one I'd renamed. So as far as I can comprehend, confluence still tried to access the home directory on C:, and when unable to find one - it created a new one..

I have successfully reversed these changes and are back to my working future state.

<br />


author: Nic Brough -Adaptavist-
body: Excellent approach, not sure why it did that. Your thoughts on what has happened look right to me - it's simply not recognised the change.

Could you tell us where the "confluence-init.properties" file you edited was and what was in it before (and what's in it now?)


author: Sorin Sbarnea (Citrix)
body: Probably tomcat was not stopped properly, always check if the tomcat service is still running.


author: Espen B?rrud
body: The confluence-init.properties I edited, was located in C:\\Program Files (x86)\\Atlassian\\Confluence\\confluence\\WEB-INF\\classes

The file contained basically only this value

confluence.home = C:\\\\Program Files (x86)\\\\Atlassian\\\\Application Data\\\\Confluence

What I found peculiar, was that this line was basically repeated 4 times, due to some default example-texts. I commented out the first three duplicates (#), and edited the last one to be confluence.home = D:\\\\ConfluenceData


author: Nic Brough -Adaptavist-
body: That should have worked according to my notes. I've seen duplicate lines appear if an installation is stopped part-way through and restarted without tidying up, but yes, you should only have one line.


author: Sorin Sbarnea (Citrix)
body: I you are carefull you may be able to do this even without changin Confluence config. Replace the attachment directory with a directory junction and this will solve your problem.


Tags: directory

home