Commcare data export tool - external SQL db url issue

190 views
Skip to first unread message

Ben

unread,
Jul 19, 2013, 12:45:48 AM7/19/13
to commcar...@googlegroups.com
Hi, I have successfully used the data export tool as described on the export tool page.

(Using Mac OS X 10.8.4)

However, I'm trying to get it to link to an external SQL database that resides on a hostpapa web server. I am having trouble with the database url that is entered into the "--export" section of the query string (in BOLD below)

commcare-export --output-format sql --output json:mysql://[server-address]:3306/[database-name]?user=[user-name]&password=[db-password] --project [project-name] --query /Users/Ben/Downloads/sale.xlsx

Everything else in the above string works as I have successfully exported to .xlsx format and to SQL format (into SQLite3) on my local machine.

However, when I run the above command, it comes back with this error:

[1] 565
-bash: --project: command not found
Bens-MacBook-Pro:~ Ben$ usage: Output a customized export of CommCareHQ data.
commcare-hq-export: error: argument --project is required

Again, I know that the project name I have entered is correct. So I'm assuming it's something to do with the db url address. However, I know all the details for the db (e.g. server name, port, password, username) are correct as I have separately used mySQL from terminal to connect to the database using the same details.

Any help on this would be much appreciated.

Cheers
Ben

Kenn Knowles

unread,
Jul 22, 2013, 10:42:20 AM7/22/13
to Ben
Hi Ben, (including commcare-users for initial response, and then we can discuss further off the mailing list)

Thanks for giving the tool a shot!

If the command you have pasted is exactly as entered into the terminal, except for the pieces you have redacted, then I can offer some ideas:
  1. The database URL needs to be in single quotes since the & character is special to the terminal. It is splitting it into two commands, and that is why the first command does not think it received the --project parameter.
  2. The database URL may need some adjusting:
Let me know if this helps,

- Kenn


Ben

--
You received this message because you are subscribed to the Google Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ben Nardone

unread,
Dec 18, 2014, 6:18:49 PM12/18/14
to commcar...@googlegroups.com, be...@pollinateenergy.org, kkno...@dimagi.com


Wondering if anyone's used this tool to sync with a MS SQLServer database and might be able to advise on the URL/parameter format.
:)Ben

Cory Zue

unread,
Dec 18, 2014, 6:20:55 PM12/18/14
to commcar...@googlegroups.com, be...@pollinateenergy.org, Kenn Knowles
I think the link above on this thread has the format we expect to work: http://docs.sqlalchemy.org/en/rel_0_8/core/engines.html#microsoft-sql-server

For more options, visit https://groups.google.com/d/optout.

lusweti david

unread,
Dec 19, 2014, 12:57:21 AM12/19/14
to commcar...@googlegroups.com
Dear Sir/Madam,

Please unsubscribe me from this group mail.
Reply all
Reply to author
Forward
0 new messages