I assume You use Tableau Server to keep your extract.
You don't need to insert database details. Just create a dashboard, set datasource as extract and publish dashboard to Tableau server.
Then using tabcmd run a refreshextracts command (after loging in):
tabcmd login -s http://localhost -u jsmith -p p@ssw0rd!
tabcmd refreshextracts dashboard name or tabcmd refreshextracts sheetname
tabcmd Commands - here's the list of all commands available for refreshextracts.
I need to publish one data source (not dashboard) and this data source need to contain both history and current .
But on a daily basis only the current need to be refresh
extracted datasource is usually being published together with dashboard.
But if you want to publish only datasource (not sure why you want to do that) go to Server / Publish Datasource
and then use tabcmd refreshextracts and refer to datasource name to perform full/incremental update.
you can access list of published data sources from main tableau server page
you can also use publish command with tabcmd to publish .tde file directly from computer:
tabcmd publish "C:\Tableau Workbooks\analysis_sfdc.tde" -n "Sales Analysis" --oauth-username "username" --save-oauth
but I think that it's reinventing the wheel..