Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket migration fails because of the database

Nicolaj Hein Aarøe May 18, 2018

Hi,

First of all, a bit of information / background.

We are running Bitbucket 5.10 with a starter user license currently (looking to expand in the near feature).

First, we migrated the Bitbucket database from being an internal one, to an external server with MS sql 2014 installed though the migration wizard. Everything went smooth this time around.

But now we are looking to migrate it from the 2014 installation, to another external server with MS sql 2016 installed instead. But we keep running into this error, even if we re-create the database on the new server, with no information in it at all.

Error message:

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.

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(DatabaseMigrationTask.java:86)
	com.atlassian.stash.internal.maintenance.migration.DatabaseMigrationTask.run(DatabaseMigrationTask.java:51)
	com.atlassian.stash.internal.maintenance.DefaultMaintenanceTaskMonitor.run(DefaultMaintenanceTaskMonitor.java:212)
	...
A backup file could not be created.
	com.atlassian.stash.internal.maintenance.backup.BackupPhase.run(BackupPhase.java:77)
	com.atlassian.stash.internal.maintenance.CompositeMaintenanceTask$Step.run(CompositeMaintenanceTask.java:130)
	com.atlassian.stash.internal.maintenance.CompositeMaintenanceTask.run(CompositeMaintenanceTask.java:69)
	...
Backup of Bitbucket configuration failed.
	com.atlassian.stash.internal.maintenance.backup.ConfigurationBackupStep.run(ConfigurationBackupStep.java:71)
	com.atlassian.stash.internal.maintenance.CompositeMaintenanceTask$Step.run(CompositeMaintenanceTask.java:130)
	com.atlassian.stash.internal.maintenance.CompositeMaintenanceTask.run(CompositeMaintenanceTask.java:69)
	...
C:\Atlassian\ApplicationData\Bitbucket\shared\bitbucket.properties (Access is denied)
	java.io.FileInputStream.open0(Native Method)
	java.io.FileInputStream.open(Unknown Source)
	java.io.FileInputStream.<init>(Unknown Source)
	...  

 

Any help is much appriciated!! :)

2 answers

1 accepted

1 vote
Answer accepted
Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 18, 2018

Hi @Nicolaj Hein Aarøe,

 

While seeing the error I think the issue with the permission because if you have been created an empty database while migrating the bitbucket server data then it should not throw this error.

The bitbucket.properties file will contain the database details like name, Url..etc please make sure this file should have appropriate access.

Nicolaj Hein Aarøe May 21, 2018

Hi Yogesh,

I wouldn't doubt it could be a permission issue, kinda what i was thinking as well.

But i'm a bit clueless to who i need to assaign the access to the .properties file,

Should it be the user on Bitbucket?

The user atlbitbucket that runs the services?

or an administetiv Active Directory user with access to the databases?

Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2018

Hi @Nicolaj Hein Aarøe,

Actually, the file contains the details of the database so while migrating data the database details should be able to read.

Just give the full permission to .properties file and the location where it contains.

Nicolaj Hein Aarøe May 22, 2018

Hi Yogesh,

 

Thanks for the help resolveing this issue.

It is now working :)

1 vote
Danyal Iqbal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 18, 2018
C:\Atlassian\ApplicationData\Bitbucket\shared\bitbucket.properties 

is not accessible. Make sure it is accessible by the user executing the process and retry.

Nicolaj Hein Aarøe May 21, 2018

Hi Danyal,

 

Thanks for your reply.

Should the user that makes the migration have the access to this file? as that is an internal Bitbucket administrator, that is only created in Bitbucket.

Danyal Iqbal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2018

Yes, the user (windows/AD) running the migration should have access to the *.properties file.

Nicolaj Hein Aarøe May 22, 2018

Hi Danyal

 

Thanks for the help resolveing this issue.

It is now working :)

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events