Importing projects from Mantis into JIRA


I'm evaluating JIRA and have just tried to import a single existing project from Mantis. The import fails almost immediately though, with the following exception:

2012-05-03 10:57:09,939 INFO - Import started by admin using com.atlassian.jira.plugins.importer.imports.mantis.MantisDataBean
2012-05-03 10:57:09,954 INFO - ------------------------------
2012-05-03 10:57:09,954 INFO - Importing: Users
2012-05-03 10:57:09,954 INFO - ------------------------------
2012-05-03 10:57:09,954 INFO - Only new items will be imported
2012-05-03 10:57:10,017 INFO - 11 users associated with import.

[note: I have omitted the usernames listed in the log]

2012-05-03 10:57:10,892 INFO - ------------------------------
2012-05-03 10:57:10,892 INFO - Finished Importing : Users
2012-05-03 10:57:10,892 INFO - ------------------------------
2012-05-03 10:57:10,892 INFO - 8 users successfully created.
2012-05-03 10:57:10,892 INFO - Retrieving projects...
2012-05-03 10:57:10,892 INFO - ------------------------------
2012-05-03 10:57:10,892 INFO - Importing: Issues
2012-05-03 10:57:10,892 INFO - ------------------------------
2012-05-03 10:57:10,892 INFO - Only new items will be imported
2012-05-03 10:57:10,907 INFO - ------------------------------
2012-05-03 10:57:10,907 INFO - Finished Importing : Issues
2012-05-03 10:57:10,907 INFO - ------------------------------
2012-05-03 10:57:10,907 ERROR - Unexpected failure occurred. Importer will stop immediately. Data maybe in an unstable state
com.atlassian.jira.plugins.importer.SQLRuntimeException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
at com.atlassian.jira.plugins.importer.web.JdbcConnection.queryDb(
at com.atlassian.jira.plugins.importer.web.JdbcConnection.queryDb(
at com.atlassian.jira.plugins.importer.imports.mantis.MantisDataBean.getTotalIssues(
at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(
at com.atlassian.jira.task.TaskManagerImpl$
at java.util.concurrent.FutureTask$Sync.innerRun(
at java.util.concurrent.Executors$
at java.util.concurrent.FutureTask$Sync.innerRun(
at com.atlassian.multitenant.impl.DefaultMultiTenantManager.runForTenant(
at com.atlassian.multitenant.juc.MultiTenantExecutors$
at com.atlassian.jira.task.ForkedThreadExecutor$
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at com.mysql.jdbc.Util.handleNewInstance(
at com.mysql.jdbc.Util.getInstance(
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.sendCommand(
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
at com.mysql.jdbc.ConnectionImpl.execSQL(
at com.mysql.jdbc.PreparedStatement.executeInternal(
at com.mysql.jdbc.PreparedStatement.executeQuery(
at com.atlassian.jira.plugins.importer.web.JdbcConnection.queryDb(
... 15 more
2012-05-03 10:57:10,907 INFO - No issues need to be reindexed.

Both JIRA's database and Mantis' database are in the same MySQL instance (MySQL 5.5.18). We are using Mantis 1.2.8.

Please help.

6 answers

Hi Richard,

This looks like an issue that you should report to our support team so they can fully investigate it. Please head over to, sign up, and report this problem in the "JIRA" project.

When support figures out the issue, please take a moment to update this question so others may be able to find the solution.


Hi Simon

Thanks for the suggestion. I actually had some really good help from one of your support team earlier in the day.

I actually figured it out just before I got his email though: on the import screen, it looked like the Mantis username / password was optional so without thinking about it too much, I didn't fill them in (I thought it would get everything it needed from the database, the username and password for which I *did* provide). But, it seems that it does need a Mantis username/password so it can do whatever it does with the url to Mantis properly.

So I tried again with those values entered (I used my Mantis admin user) and it worked. Actually, it worked really well, quite impressed :)

But if you guys would like a bit of hopefully constructive feedback it would be maybe to add a little bit of extra validation on that screen, or a more informative error message for when this goes wrong.

Like I said though, it's working really well now, just evaluating it for our place, and it seems really good.


I also noticed that the URL as I typed it appeared as the 'linkback' to the original issue in the imported issues. I entered 'localhost' because I was on the box at the time and I knew it would be able to connect. But I didn't realise that would end up in the issue as a link, which from a browser on another machine obviously wont work. So it might be useful to have a bit of a hint against that field e.g. "the value you enter for the Mantis URL will appear as a link in the issue so please enter a full URL that any machine on the network will be able to access, rather than just 'localhost'"

Hope that's helpful (I'm not trying to be a pain, honest!) :)

No problem Richard, thank you! Would you mind summarizing your feedback as a new issue on our official feature request tracker?



you can also try Task Adapter, it provides another way of migrating tasks from Mantis bug tracker to Jira. it's an external program where you can enter Mantis and Jira website URLs and it will use remote APIs provided by those systems. no SQL access or any plugin installation is required.

We had an issue with our version of mantis being very...very old, and customized. We also will need to migrate close to 100,000 issues.

So we actually wrote a simple php page (just modified the default report page from mantis) that filters the project/dates we are migtrating and generates a JSON payload.

YOu can use the JSON importer found in JIM, or for bonus points just have the php page post the json payload direct to JIRA's rest APIs.

This allows _full_ migration of attachments,watchers, comments, links, history, etc.

// how to setup filter and get initial list of bugs
$filter = filter_get_default();

// Dates
$filter['start_day']=$start_day; // yep, only integer
$filter['end_day']=$end_day; // dido
$filter['do_filter_by_date']='on'; //IMPORTANT - to use dates, do_filter_by_date must = "on"

	$result = filter_get_bug_rows( $t_page_number, $t_per_page, $t_page_count, $t_bug_count, $filter , $projectId);
	//$result = filter_get_bug_rows( $t_page_number, $t_per_page, $t_page_count, $t_bug_count );
	$row_count = sizeof( $result );

Then just loop through, printing the json payload depending on your target.

You'll need to make some additional queries to the "monitor","bug_notes", and other tables for non-core values, but all the basic plumbing is already there. Just copy and modify to your needs.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,294 views 5 10
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you