How to move the shared-home folder in Confluence Data Center
Purpose
The shared-home folder in Confluence Data Center stores the Confluence attachments, backups, rendered previews, among other content. When migrating to a different disk or making changes to Confluence Data Center, you might want to update the location of your shared-home directory.
Finding the shared home for your Confluence application
The location of your shared-home folder can be found in your <confluence-home>/confluence.cfg.xml
file in the confluence.cluster.home
property.
The location of the Confluence home directory is defined when you install Confluence. This location is stored in the confluence-init.properties
file, which is located in the confluence/WEB-INF/classes
directory of your Confluence Installation directory. When Confluence is running you can find the location of the home directory in General Configuration > System Information > Confluence Information - Confluence Home. >
Solution
For this example, we will use /OLD_HOME/shared/
as the old path, and /NEW_HOME/shared/
as the new path. To update the shared-home folder:
- Shutdown Confluence
Edit the
confluence_home/confluence.cfg.xml
and update the following line:<property name="confluence.cluster.home">/OLD_HOME/shared</property>
This property for DC instance would be available if Confluence DC is running in cluster mode only.
- Change that value to the new path:
/NEW_HOME/shared/
Make sure to do this for every node of Confluence, as each node has a local copy of this file Run the following query and look for <backupPath>...</backupPath> tag:
select BANDANAVALUE from BANDANA where BANDANACONTEXT = '_GLOBAL' and BANDANAKEY = 'atlassian.confluence.settings';
Run the following UPDATE statement on the database (this example is for PostgreSQL):
update BANDANA set BANDANAVALUE = REPLACE(BANDANAVALUE, '<backupPath>OLD_BACKUP_PATH</backupPath>', '<backupPath>/NEW_HOME/shared/backups</backupPath>'); where BANDANACONTEXT = '_GLOBAL' and BANDANAKEY = 'atlassian.confluence.settings';
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Copy any contents under the previous shared-home folder to the new location:
cp -R /OLD_HOME/shared/ /NEW_HOME/shared/
Restart All the Confluence nodes
Once all the steps are completed, perform the following verifications to check that the new folder is in use:
- Confirm your attachments are accessible from each node of Confluence
- Create an XML backup (Back up a Site) and confirm that it is created under the new location.
If the behaviour is not the expected, please review the solution/workaround stated in CONFSERVER-53451 - Getting issue details... STATUS
If you prefer to modify the backup location from your Confluence UI and specific a different location (outside the shared-home directory), you can follow the steps outlined in Configuring Backups > Enabling Backup Path Configuration