Connecting Bitbucket to SQL Server: A Comprehensive Guide 

Home > Blog > Connecting Bitbucket to SQL Server: A Comprehensive Guide 

By: Hemanth Kumar
Published: February 17, 2025
Bitbucket to SQL Server

Introduction 

Integrating Bitbucket, Jira, and SQL Server is crucial for ensuring seamless development workflows, efficient version control, and optimized database management. This guide focuses on configuring Bitbucket SQL Server integration to enhance performance, scalability, and security. 

Why Integration is Important 

Integrating Bitbucket with SQL Server is crucial for ensuring high availability, better performance, and scalability of your source code management system. A well-configured database improves data consistency, enhances query execution speeds, and provides better backup and recovery options. By using SQL Server and Jira consulting, you can achieve seamless project tracking and efficient workflow management.

  • Improved Performance: Faster query processing and optimized data storage for large repositories. 
  • Scalability: Support for growing development teams and larger data sets without performance degradation. 
  • Reliability: More robust database management with transactional consistency and failover support. 
  • Security: Enhanced authentication, role-based access, and compliance with enterprise security policies. 

How MicroGenesis Can Help 

As an Atlassian Platinum Partner, MicroGenesis provides expert guidance and end-to-end support in integrating Bitbucket SQL Server integration along with Jira SQL Server connectivity. Our expertise includes: 

  • Consultation & Planning: Understanding your infrastructure and recommending the best integration approach. 
  • Database Setup & Optimization: Configuring SQL Server for optimal Bitbucket performance. 
  • Migration Assistance: Seamless transition from other databases to SQL Server without downtime. 
  • Performance Tuning & Security Hardening: Enhancing SQL Server configurations to improve speed and safeguard data. 
  • Ongoing Support & Maintenance: Continuous monitoring, troubleshooting, and upgrades for a hassle-free experience. 

Prerequisites 

Before proceeding, ensure the following: 

  • A running instance of Microsoft SQL Server. 
  • Administrative access to SQL Server. 
  • Bitbucket is installed but not yet configured. 
  • A backup of any existing database if you are migrating. 

Read more: Top 10 Jira Tips & Tricks

Step 1: Install SQL Server 

Ensure that SQL Server is installed and running on a machine accessible to Bitbucket. For supported versions, refer to Bitbucket’s official documentation. 

Step 2: Create a Database for Bitbucket 

Execute the following commands in SQL Server Management Studio (SSMS) to create the Bitbucket database: 

CREATE DATABASE bitbucket; 
GO 
USE bitbucket; 
GO 
ALTER DATABASE bitbucket SET ALLOW_SNAPSHOT_ISOLATION ON; 
GO 
ALTER DATABASE bitbucket SET READ_COMMITTED_SNAPSHOT ON; 
GO 
ALTER DATABASE bitbucket COLLATE SQL_Latin1_General_CP1_CS_AS; 
GO 
SET NOCOUNT OFF; 
GO 
  

Step 3: Create a Dedicated Database User 

To create a user with the required permissions, run the following commands: 

USE master; 
GO 
CREATE LOGIN bitbucketuser WITH PASSWORD=N’password’, DEFAULT_DATABASE=bitbucket, CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF; 
GO 
ALTER AUTHORIZATION ON DATABASE::bitbucket TO bitbucketuser; 
GO 
  

The bitbucketuser must be assigned the db_owner role for proper Bitbucket interaction. 

Step 4: Configure SQL Server for Remote Access 

Ensure TCP/IP is enabled for remote connectivity: 

  1. Open SQL Server Configuration Manager. 
  1. Navigate to SQL Server Network Configuration > Protocols for <instance>. 
  1. Enable TCP/IP. 
  1. Restart the SQL Server instance. 

Step 5: Set Authentication Mode 

Check if SQL Server is set to Mixed Authentication Mode: 

  1. Open SSMS and connect to your SQL Server instance. 
  1. Right-click the server and select Properties. 
  1. Go to Security and enable SQL Server and Windows Authentication mode. 
  1. Restart the SQL Server instance. 

Step 6: Connect Bitbucket to SQL Server 

During Bitbucket installation: 

  1. Select External at the Database step. 
  1. Choose SQL Server as the database type. 
  1. Enter the database details:  
  1. Hostname: The IP or hostname of the database server. 
  1. Port: Default is 1433. 
  1. Database Name: bitbucket. 
  1. Username: bitbucketuser. 
  1. Password: password. 
  1. Click Next to complete the setup. 

Step 7: Migrating an Existing Database 

If migrating from another database: 

  1. In Bitbucket, navigate to Settings > Database. 
  1. Click Migrate database. 
  1. Select SQL Server as the target database. 
  1. Provide the necessary connection details. 
  1. Click Start Migration. 

Step 8: Configuring Named Instances 

For SQL Server named instances, modify the bitbucket.properties file to specify the instance: 

jdbc.url=jdbc:sqlserver://<server>\<instance>:1433;databaseName=bitbucket 
  

Restart Bitbucket after making changes. 

Step 9: Enable Integrated Authentication (Optional) 

For Windows Authentication Mode: 

  1. Rename the appropriate JDBC DLL (x64 or x86) to sqljdbc_auth.dll and place it in lib/native. 
  1. Modify _start-webapp.bat to include: set JVM_LIBRARY_PATH=%BITBUCKET_HOME%\lib\native 
      
  1. Edit bitbucket.properties to include: jdbc.url=jdbc:sqlserver://<server>:1433;databaseName=bitbucket;integratedSecurity=true 
      
  1. Ensure Bitbucket runs under the correct Windows user. 

Dig Deeper: How Jira Service Management Transforms Efficiency in the Transport & Logistics Industry 

Step 10: Install JDBC Driver 

If the SQL Server JDBC driver is not bundled: 

  1. Download the driver from Microsoft. 
  1. Copy the JAR file to <Bitbucket Home Directory>/lib. 
  1. Restart Bitbucket. 

Conclusion 

By implementing Bitbucket SQL Server integration, organizations can achieve a more reliable and high-performing development workflow. This setup ensures that your Bitbucket, Jira, and SQL Server environments work together seamlessly, improving data management, scalability, and security. Whether you need assistance with setup, optimization, or maintenance, a digital transformation company can help drive efficiency, MicroGenesis, as an Atlassian Platinum Partner, has the expertise to make your integration smooth and future-proof. 

Related Articles