DRAFT - Migrating Stash to another server
This page...
... describes how to move your Bitbucket Server installation from one physical machine to a different machine.
If you want to migrate Bitbucket Server to a different DBMS...
... read Using the Database Migration Wizard instead.
If you're upgrading Bitbucket Server...
... read the Bitbucket Server upgrade guide too. You can upgrade Bitbucket Server either before or after you migrate Bitbucket Server.
For most scenarios, the overall procedure involves the following 4 steps, although your situation may not require all of these:
1. Prepare for the migration
In preparation for migrating Bitbucket Server to another server, check that you have done the following:
- Confirm that the operating system, database, other applicable platforms and hardware on the new machine will comply with the requirements for Bitbucket Server.
- Check for any known migration issues in the Bitbucket Server Knowledge Base.
- Alert users to the forthcoming Bitbucket Server service outage.
- Ensure that users will not be able to update existing Bitbucket Server data during the migration. You can do this by temporarily changing the access permissions for Bitbucket Server.
- Make sure you have created a user in Bitbucket Server (not in your external user directory) that has System Administrator global permissions so as to avoid being locked out of Bitbucket Server in case the new server does not have access to your external user directory.
2. Back up Bitbucket Server
Back up Bitbucket Server. See Data recovery and backups for detailed information.
Stop Bitbucket Server. See Starting and stopping Bitbucket Server.
3. Restore Bitbucket Server to the different machine
If you want Bitbucket Server to use the same DB as before, refer to...
If you want Bitbucket Server to connect to a new DB instance, refer to...
See Data recovery and backups for detailed information.
- Set up an instance of the same version of Bitbucket Server on the new machine by doing one of the following:
- Install Bitbucket Server using the Bitbucket Server installer, if available for your version. See Running the Bitbucket Server installer. At the 'Select Bitbucket Server Home' step, browse to the newly restored Bitbucket home directory (as defined by the
BITBUCKET_HOMEvariable – see Bitbucket home directory). - Either install Bitbucket Server manually from a downloaded archive file (see Install Bitbucket Server from an archive file), or make an archive of the old Bitbucket Server installation directory and copy it across to the new machine. In either case, you'll need to redefine the value for
BITBUCKET_HOME, using the new location of your copied home directory. See Bitbucket Server home directory for more information.
- Install Bitbucket Server using the Bitbucket Server installer, if available for your version. See Running the Bitbucket Server installer. At the 'Select Bitbucket Server Home' step, browse to the newly restored Bitbucket home directory (as defined by the
- If you are continuing to use the Bitbucket Server embedded database, you should now be able to start Bitbucket Server on the new machine and have all your data available. Once you have confirmed that the new installation of Bitbucket Server is working correctly, revert the access permissions for Bitbucket Server to their original values.
- If you moved the Bitbucket Server data by performing a database export and import, carry on to Step 4 below to update the bitbucket.properties file in the
<Bitbucket home directory>.
4. Update the Bitbucket Server configuration
If you moved the Bitbucket Server data by performing a database export, you must update the bitbucket.properties file in the <Bitbucket home directory> with the changed configuration parameters for the database connection.
The configuration parameters are described in Bitbucket Server config properties.
Once the configuration parameters are updated, you should be able to start Bitbucket Server on the new machine and have all your data available.
Once you have confirmed that the new installation of Bitbucket Server is working correctly, revert the access permissions for Bitbucket Server to their original values.