It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Migrating Bitbucket Server database to MySQL - Unknown column 'closed_timestamp' in 'field list'

We’re trying to get our server version of Bitbucket (currently v4.8.1) onto the latest update. However our version of MSSQL is no longer supported (2008R2).

The plan then was to migrate the database to a supported version of MySQL and once this was done then update Bitbucket.

However when trying to migrate to MySQL 5.6.16 we are getting the following error:

Bitbucket could not be migrated to the new database. Some data may have already been written to the new database leaving it in an inconsistent state. You will need to empty or recreate the new database before trying again.        

   com.atlassian.stash.internal.maintenance.migration.DatabaseMigrationTask.convertToMigrationException(         ...  


Failed to execute change: Insert Row; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'closed_timestamp' in 'field list'         com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseDao.insert(         com.atlassian.stash.internal.backup.liquibase.DatabaseUpdater.onChangesetContent(         com.atlassian.stash.internal.backup.liquibase.ChangeSetReader.endElement(         ...  


Unknown column 'closed_timestamp' in 'field list'         sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)         sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)         sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)         ...

2 answers

1 accepted

0 votes
Answer accepted
Jeff Thomas Atlassian Team Aug 25, 2017

Hi Darren,

The closed_timestamp column did not exist until an upgrade to Bitbucket Server 4.10. So, it appears that at some point, your MSSQL database was upgraded to at least 4.10. On the first start of a new version, all of the DB upgrade tasks will be run. In order to roll back to a previous version, you must restore the DB and file system to a state before the upgrade.

Do you recall which version that you may have run against the database?

If not, run the following SQL and provide atleast the first line, we'll be able to identify the version from it.

select * from databasechangelog order by dateexecuted desc;

If the highest version that was upgraded to was 4.14 or below, we can do the following:

  1. Upgrade to the highest version that was run, ie 4.14, as MSSQL 2008 is still supported (although deprecated)
  2. Migrate to MySQL and you should not receive any errors

Just in case you haven't seen yet, we typically don't recommend MySQL for larger instances due to performance issues, more information is available on Connecting Bitbucket Server to MySQL.

Hi Jeff,

as in attached photo it looks like database is on v4.10. I'll give it a go upgrading to this version on server then trying migration again after weekend / bank holiday.

I had seen the info about performance with MySQL so may review options again before I do this.

Thanks for your help so far


Jeff Thomas Atlassian Team Aug 25, 2017

Sounds good, Darren. Let us know how the upgrade to 4.10 and migration go.

Hi Jeff,

after the upgrade everything worked as it should.

We've stuck with MySQL for the moment and will see how that performs. Can always migrate again if it becomes an issue.

Thanks again for you help

Jeff Thomas Atlassian Team Aug 30, 2017

Great to hear, Darren!

0 votes
Ana Retamal Atlassian Team Aug 25, 2017

Hi Darren, it looks like the target database is not empty. Can you try dropping it and then recreate it again? If after that it still fails, we'll need to see logs to get a better understanding of what's happening there.




Hi Ana,

it was a newly created database. Have just dropped and recreated to make sure and got the same error.

Which logs do you need, and where do I send them?



Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Bitbucket

Contest: Share your custom Bitbucket Pipe and win

Announced in this blog, this holiday season we’re celebrating all things CI/CD and between now and the end of 2019 we’ll be showcasing content, use cases, feature announcements and more. One featur...

1,148 views 5 4
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you