"The component of the database name of the object qualifier must be the name of the current database" error on upgrade to Confluence 6.1+
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Confluence throws the following database error while trying to upgrade to 6.1.0 or later when using Microsoft SQL Server database:
Caused by: java.sql.SQLException: The database name component of the object qualifier must be the name of the current database.
Diagnosis
Environment
- Microsoft SQL Server
Cause
- The database name set in
<home-directory>/confluence.cfg.xml
does not match the name of the Microsoft SQL database. The database name is case-sensitive. - If upgrading to the latest version (6.15.x), you may be hitting the following bug: CONFSERVER-58264 - Getting issue details... STATUS
- if upgrading to a version before 6.2.2, you may be hitting the following bug: CONFSERVER-52103 - Getting issue details... STATUS
Resolution for Confluence 6.6.x or later
Stop Confluence
Back up your home directory and installation directory before making any changes.
Get the name of your database by running this SQL query:
SELECT name, database_id, create_date FROM sys.databases;
If you configured the database with a JDBC URL when you set up Confluence, compare the database name from step 3, with the database name configured in the
hibernate.connection.url
property in your<home-directory>/confluence.cfg.xml
file.<property name="hibernate.connection.url">jdbc:sqlserver://<hostname>:<port>;databaseName=<database></property>
If you configured the database with a JNDI datasource when you set up Confluence (assuming you followed this documentation page for JNDI datasource configuration), compare the database name from step 3, with the database name in the
url
attribute, located in the JNDI Datasource configuration in your<installation-directory>/conf/server.xml
file.<Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource" username="yourDatabaseUser" password="yourDatabasePassword" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://<hostname>:<port>;databaseName=<database>" maxTotal="60" maxIdle="20" validationQuery="select 1" />
- Update the database name so that it matches the name of the database from the SQL query in step 3 (note it is case sensitive)
- Start Confluence
Resolution for Confluence 6.5.x or earlier
The steps are the same with the exception being the connection URL and JTDS driver
Stop Confluence
Back up your home directory and installation directory before making any changes.
Get the name of your database by running this SQL query:
SELECT name, database_id, create_date FROM sys.databases;
If you configured the database with a JDBC URL when you set up Confluence, compare the database name from step 3, with the database name configured in the
hibernate.connection.url
property in your<home-directory>/confluence.cfg.xml
file.<property name="hibernate.connection.url">jdbc:jtds:sqlserver://{host}:{port}/{database_name}</property>
If you configured the database with a JNDI datasource when you set up Confluence (assuming you followed this documentation page for JNDI datasource configuration), compare the database name from step 3, with the database name in the
url
attribute, located in the JNDI Datasource configuration in your<installation-directory>/conf/server.xml
file.<Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource" username="yourDatabaseUser" password="yourDatabasePassword" driverClassName="net.sourceforge.jtds.jdbc.Driver" url="jdbc:jtds:sqlserver://{host}:{port}/{database_name}" maxTotal="60" maxIdle="20" validationQuery="select 1" />
- Update the database name so that it matches the name of the database from the SQL query in step 3 (note it is case sensitive)
- Start Confluence