Confluence Docs 3.0 : Migrating Confluence Between Servers This page last changed on Sep 29, 2009 by jlargman.
| Some customers have experienced problems with Confluence's search functions after performing a migration, or that the content of their {`recently-updated`} macro is not being updated correctly. Errors in the `atlassian-confluence.log` file corroborate such problems. Hence, to avoid these issues, it is strongly recommended that you perform a rebuild of your content indices after performing a migration.
### How to Create a Test or Development Instance
| Development licenses are available for any Commercial or Academic license. Create one or contact us for help.
Adminstrators may need to move a Confluence instance from one server to another for upgrades or downtime. This page tells you how to copy a Confluence instance from one server to another. For example, you may want to transfer your current production snapshot to a test server as permitted in the licence agreement.
| Avoid upgrades while transferring If you are planning to switch databases, application servers or Confluence versions, perform the transfer and test that it is successful separately to any other changes.
2. ## Transferring Confluence To Another Server Using The Same Operating System If the operating systems on both servers are the same, then the home and install folders can be copied straight into an identical external database and user management setup. On the original server, create zips of the Confleunce install and home directories. Copy the zips to the new server. On the new server, unzip the install and home directories. Windows users should avoid unzipping with the Windows built-in extractor, instead use Winzip or the free 7Zip.
   | If you are changing the location of the home directory, open the Confluence install\confluence\WEB-INF\classes directory and edit confluence-init.properties by changing the line starting with 'confluence.home='.
1. Modify the location of your war file if need be. If using Tomcat, this is likely in /Conf/Catalina/localhost. You'll want to make sure the docbase attribute is pointing to the right location. This next step is dependent on your database: For users of the internal database, the content is stored inside the home directory. You should switch to an external database after the transfer is successful. For databases stored on another server: change the user account or datasource permissions so that the new server has the same network access permissions as the original. Then confirm from the new server that the hostname can be resolved and is listening for database connections on the expected port. For external databases stored locally: on the original server, create a manual database backup using a native db dump backup tool. Copy the database backup to the new server. On the new server, install or upgrade the database version to match the original server. Import the database backup. Add a database user account with the same username and password as the original. Provide the user with the full access to the imported database. Use a database administration tool to confirm that the user can login from the localhost. To modify any database connection information, go to the Confluence home directory and edit confluence.cfg.xml. The connection URL is set under hibernate.connection.url. Ensure it does not point to your production database server. If you are using internal user management, skip this step. For users who have JIRA or LDAP integration, provide the new server with network or local access to the same hosts as the original. If this is a true test instance, set up a test of your JIRA instance or LDAP server so as not to disrupt production systems and change the server.xml or atlassian-user.xml files to point to the appropriate test servers. Note that it might be acceptable to use a production connection here, as users won't be logging on to the test system in high volume. If appropriate, make sure no emails are sent out from the test system. Start Confluence. Go to Administration > License Details and add your development license key. You can generate one at http://my.atlassian.com. There are more details in Getting a License for a Staging Environment. If you configured Confluence as a Windows service, repeat those instructions. Add your development license key. ## Transferring Confluence To Another Server Using a Different Operating System #### Using database tools (preferred option) If you are using the Alternate backup strategy, follow these steps: Download the proper distribution (the same one you have from your original instance) from the Download Archive. Copy your Confluence home (not install) directory from your original server (even if it was a different OS). If you are changing the location of the home directory, open the Confluence install\confluence\WEB-INF\classes directory and edit confluence-init.properties by changing the line starting with 'confluence.home='. For external databases stored locally, on the original server, create a manual database backup using a native db dump backup tool. Copy the database backup to the new server. On the new server, install or upgrade the database version to match the original server. Import the database backup. Add a database user account with the same username and password as the original. Provide the user with the full access to the imported database. Use a database administration tool to confirm that the user can login from the localhost. To modify any database connection information, go to the Confluence home directory and edit confluence.cfg.xml. The connection URL is set under hibernate.connection.url. Ensure it does not point to your production database server. If you are using internal user management, skip this step. For users who have JIRA or LDAP integration, provide the new server with network or local access to the same hosts as the original. Copy server.xml, atlassian-user.xml, osuser.xml, any patches, and any other customized files velocity or properties files. If you are using internal user management, skip this step. For users who have JIRA or LDAP integration, provide the new server with network or local access to the same hosts as the original. If this is a true test instance, set up a test of your JIRA instance or LDAP server so as not to disrupt production systems and change the server.xml or atlassian-user.xml files to point to the appropriate test servers. Note that it might be acceptable to use a production connection here, as users won't be logging on to the test system in high volume. If appropriate, make sure no emails are sent out from the test system. Start Confluence. Go to Administration > License Details and add your development license key. You can generate one at http://my.atlassian.com. There are more details in Getting a License for a Staging Environment. If you configured Confluence as a Windows service, repeat those instructions. Add your development license key. #### For XML backups (only for small to medium sized installations) If you're not yet using the Alternate backup strategy, you can do this with your regular XML backup. Create a backup and import into the new server. Create a backup from Confluence: Go to the Confluence 'Administration Console'. To do this: Open the 'Browse' menu and select 'Confluence Admin'. The 'Administration Console' view will open. Select 'Backup & Restore'. Check the 'Backup Attachments' option and select 'Backup'. Identify the current version of Confluence your are using, displayed at the bottom of each Confluence page. Download the same version as you are currently using to the new server, which may be the current Confluence release, or an older version. Go to Administration > License Details and add your development license key. You can generate one at http://my.atlassian.com. There are more details in Getting a License for a Staging Environment. Using the same version, follow the Upgrading Confluence guide. Add your development license key. Restore your XML Backup From <<Administration > Backup and Restore>>. If appropriate, make sure no emails are sent out from the test system. ## Ensuring no contact with production systems To ensure no contact with external systems, you will need to disable both inbound and outbound mail services. Disable global outbound mail by running the following database query:
       SELECT * FROM BANDANA WHERE BANDANAKEY = 'atlassian.confluence.smtp.mail.accounts';
2. Disable space-level mail archiving by running the following database query:
       SELECT * FROM BANDANA WHERE BANDANAKEY = 'atlassian.confluence.space.mailaccounts';
Change the 'SELECT *' to a 'DELETE' in the above queries once you are sure you want to remove the specified accounts. Once this is done, you can start your test instance without any mails being sent or retrieved. Think carefully about other plugins which may access production systems (SQL macro, JIRA macro, etc.). I They write content, or create unwanted load on external systems, they should be disabled promptly after starting the test instance.
| Blog post on Moving Confluence from Windows to Linux Ricky Sheaves (calebscreek) has written an interesting blog post on Moving Confluence from Windows to (Ubuntu) Linux.
### Merging instances If you wish to merge two instances, you can consider using the remote import plugin. This plugin is currently unsupported. The supported method would be to export a space and then import spaces one by one. The two instances must be the same version.

Document generated by Confluence on Nov 05, 2009 23:26