---
schema_version: "1"
id: ae3939a9af01d677782ccbbafc423dbdb9fe6899334e33bb32dbab36488929db
title: Automate Extract Refresh Tasks from the Command Line
collection: tableau
version: current
locale: en-gb
portal_url: https://docs.salesforce.com/tableau/current/en-gb/online/to_refresh_extract_commandline.md
canonical_url: https://help.tableau.com/current/online/en-gb/to_refresh_extract_commandline.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 62ebaba475fc5e2c7245a15b17c9df566fc570195a6c2c42f6ca2d3fc39d07b7
description: Automate extract refresh tasks using the Tableau Data Extract Command-Line Utility.
---
[Skip to main content](#main-content)

# Automate Extract Refresh Tasks from the Command Line

You can automate extract refresh tasks using the Tableau Data Extract Command-Line Utility. This is a command-line utility that comes with Tableau Desktop, through which you can refresh published extract data sources or append data to them from a file.

Requirements for using the Tableau Data Extract Command-Line Utility include the following:

- It is available with Tableau Desktop on Windows and can run only on a Windows system.
- It is not available with the trial version of Tableau Desktop.
- You can use it for extract data sources that don't use OAuth.
- You can use it to refresh single-connection data sources only. It does not work for multi-connection data sources.

**Deprecated October 2022:** This utility isn't available in later releases due to the [multi-factor authentication](https://help.tableau.com/current/online/en-gb/to_security_mfa.htm) requirement in Tableau Cloud. To refresh data sources or virtual connections data that Tableau Cloud can't reach directly, use Tableau Bridge instead. For more information, see [Set Up a Bridge Refresh Schedule](https://help.tableau.com/current/online/en-gb/to_sync_schedule.htm).  
  
To initiate refresh jobs using a script, use tabcmd [refreshextracts](https://help.tableau.com/current/server/en-gb/tabcmd_cmd.htm#refreshextracts-workbookname-or-datasourcename) or REST API [Run Extract Refresh Task](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#run_extract_refresh_task).

## Run the utility

1. Open the Command Prompt as an administrator and change to the Tableau Desktop bin directory. For example:
    
    `cd C:\Program Files\Tableau\Tableau 2022.4\bin`
2. Use either of the following commands, adding parameters described in the tables below.
    
    - `tableau refreshextract`
    - `tableau addfiletoextract`

**Note:** When using the utility, always specify `tableau` on the command line or in scripts, never `tableau.exe`.

**Note:** To troubleshoot, check the logs in the tableaucom.txt file in the \\My Tableau Repository\\Logs folder.

**Note:** In a multiple-site environment, specify the site to which the command applies.

## Syntax and parameters for the tableau refreshextract command

Use `tableau refreshextract` to refresh an extract on Tableau Server or Tableau Cloud. Refreshing an extract updates an existing extract with any modifications that have been made to the data source since the last refresh.

To see help for this command, at the Windows command prompt, type the following command:

`tableau help refreshextract`

### Using parameters

- All options have a full form that you use with a double hyphen (for example, `--server`).
- Some options also have a short form that you use with a single hyphen (for example, `-s`).
- If the value for an option contains spaces, enclose it in quotation marks.
- The source being refreshed must be the original data source, not an extract (`.hyper`).

### tableau refreshextract command options

<table><colgroup><col style="width: 25%;"><col style="width: 30%;"><col style="width: 45%;"></colgroup><tbody><tr><td><b>Short Form</b></td><td><b>Full Form</b></td><td><b>Description</b></td></tr><tr><td>&nbsp;</td><td><code>--source-username &lt;user name&gt;</code></td><td><p>A valid user name for the data source connection.</p><p>Use this option with <code>--source-password</code>, or use</p><p><code>--original-file</code> instead of the user name and password options.</p><p class="note"><b>Note</b>: You must provide the user name and password when refreshing a published extract, even if the data source was originally published with embedded credentials.</p></td></tr><tr><td>&nbsp;</td><td><code>--source-password "&lt;password&gt;"</code></td><td><p>The password for the data source user.</p></td></tr><tr><td>&nbsp;</td><td><p><code>--original-file &lt;path and file name&gt;</code></p><p>or</p><p><code>--original-file&nbsp;&lt;path and folder name&gt;</code></p></td><td><p>Path and file name for the data source to be refreshed on the server. For example: <code>--original-file c:\folder\file.csv</code></p><p>To refresh a multi-file data source, pass the path to a folder that contains the data files. For example: <code>--original-file c:\folder</code>.</p><p>If the file is on a network share, use the UNC format for the path: <code>\\server\path\filename.csv</code></p></td></tr><tr><td>&nbsp;</td><td><code>--force-full-refresh</code></td><td><p>If the data source is set up for incremental refreshes, use this option to force a full extract refresh. If this option is not included, an incremental refresh is performed. Not all data sources support incremental refresh.</p></td></tr><tr><td><code>-s &lt;server http address&gt;</code></td><td><code>--server  &lt;URL&gt;</code></td><td><p>The URL for the Tableau server on which the data is published.</p><p>For Tableau Cloud, specify <code>https://online.tableau.com</code>.</p></td></tr><tr><td><code>-t &lt;site id&gt;</code></td><td><code>--site &lt;siteid&gt;</code></td><td><p>In a multiple-site environment, specifies the site to which the command applies. For Tableau Cloud, use this argument if your username is associated with more than one site. For Tableau Server, if you do not specify a site, the default site is assumed.</p><p>The site id is independent of the site name, and it is indicated in the URL when you view the site in a browser. For example, if the URL for the page you see after signing in to Tableau Cloud is</p><pre xml:space="preserve">https://online.tableau.com/t/vernazza/views</pre><p>the site id is <i>vernazza</i>.</p></td></tr><tr><td>&nbsp;</td><td><code>--datasource &lt;datasource&gt;</code></td><td><p>The name of the data source, as published to Tableau Server or Tableau Cloud.</p></td></tr><tr><td>&nbsp;</td><td><code>--project &lt;projectname&gt;</code></td><td><p>The project to which the data source belongs. If this option is not included, the default project is assumed.</p><p>If the project you want to specify is a child project nested within a project hierarchy, you must use this parameter along with the <code>--parent-project-path</code> parameter.</p></td></tr><tr><td>&nbsp;</td><td><code>--parent-project-path path/to/project</code></td><td><p>If a project to which the data source is published is not at the top level of a project hierarchy, use this parameter along with the <code>--project</code> parameter to specify the path to a nested project.</p><p>Use the forward slash character&nbsp;(<code>/</code>) to delimit project levels in the hierarchy. Use the backward slash (<code>\</code>), to escape instances of forward or backward slash characters in project names.</p><p>For example, for a project named Sandbox, in project Social, under top-level Marketing:</p><p><code>--project Sandbox --parent-project-path Marketing/Social</code></p></td></tr><tr><td><code>-u &lt;user name&gt;</code></td><td><code>--username &lt;username&gt;</code></td><td><p>Valid Tableau Server or Tableau Cloud user.</p></td></tr><tr><td><code>-p "&lt;password&gt;"</code></td><td><code>--password  "&lt;password&gt;"</code></td><td><p>The password for the specified Tableau Server or Tableau Cloud user.</p></td></tr><tr><td>&nbsp;</td><td><code>--proxy-username &lt;username&gt;</code></td><td><p>The user name for a proxy server.</p></td></tr><tr><td>&nbsp;</td><td><code>--proxy-password "&lt;password&gt;"</code></td><td><p>The password for a proxy server.</p></td></tr><tr><td><code>-c "&lt;path and file name&gt;"</code></td><td><code>--config-file  "&lt;path and file name&gt;"</code></td><td><p>Path and file name information for a file containing configuration options for the command. Always enclose the path in double quotation marks. For more information, see <a href="#Using" class="xref">Using a config file</a> below.</p></td></tr></tbody></table>

### Sample tableau refreshextract command

The following command refreshes an extract named CurrentYrOverYrStats that has been published to Tableau Cloud. This command specifies the following:

- Tableau Cloud user and password.
- Tableau Cloud site and project names.
- The data source, which in this case is hosted by a cloud-based data source provider (for example, Salesforce.com), and the username and password to sign in to the hosted data source.

`C:\Program Files\Tableau\Tableau 2022.4\bin>tableau refreshextract --server https://online.tableau.com --username email@domain.com --password "OurServerPwd" --site vernazza --project "New Animations" --datasource "CurrentYrOverYrStats" --source-username database_user@hosted_datasource_provider.com --source-password "db_password"`

To refresh an extract of file-based data source, provide the path to the original file from which you created the extract. If the file is on a network share, use the UNC format instead of a mapped drive.

`C:\Program Files\Tableau\Tableau 2022.4\bin>tableau refreshextract --server https://online.tableau.com --username email@domain.com --password "OurServerPwd" --site vernazza --project "New Animations" --datasource "CurrentYrOverYrStats" --original-file "\\server\path\filename.csv"`

## Syntax for tableau addfiletoextract

Use `tableau addfiletoextract` to append file content to an extract that has been published to Tableau Server or Tableau Cloud. This command combines the two files.

If you want simply to update an existing extract with the latest changes, use the `refreshextract` command instead. Using `addfiletoextract` to update an existing extract will duplicate data instead.

To see help for this command, at the Windows command prompt, type the following command:

`tableau help addfiletoextract`

All options have a full form that you use with a double hyphen (for example, `--server`). Some options also have a short form that you use with a single hyphen (for example, `-s`). If the value for an option contains spaces, enclose it in quotation marks.

### tableau addfiletoextract command options

<table><tbody><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><b>Short Form</b></td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><b>Full Form</b></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><b>Description</b></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1">&nbsp;</td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>--file &lt;path and file name&gt;</code></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><p>Path and file name information for the data file containing data to append. The file can be from Excel, Access, a Tableau data extract, or a delimited text file. It cannot be password protected. Use UNC format if the file is on a network share. For example, <code>\\server\path\filename.csv</code></p></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>-s &lt;server http address&gt;</code></td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>--server  &lt;URL&gt;</code></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><p>The URL for the Tableau server on which the data is published.</p><p>For Tableau Cloud, specify <code>https://online.tableau.com</code>.</p></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>-t &lt;site id&gt;</code></td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>--site &lt;site id&gt;</code></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><p>In a multiple-site environment, specifies the site to which the command applies. For Tableau Cloud, you must include this argument if your username is associated with more than one site. For Tableau Server, if you do not specify a site, the default site is assumed.</p></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1">&nbsp;</td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>--datasource &lt;datasource&gt;</code></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><p>The name of the data source, as published to Tableau Server or Tableau Cloud.</p></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1">&nbsp;</td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>--project &lt;projectname&gt;</code></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><p>The project to which the data source belongs. If this option is not included, the default project is assumed.</p><p>If the project you want to specify is a child project nested within a project hierarchy, you must use this parameter along with the <code>--parent-project-path</code> parameter.</p></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1">&nbsp;</td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>--parent-project-path path/to/project</code></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><p>If a project to which the data source is published is not at the top level of a project hierarchy, use this parameter along with the <code>--project</code> parameter to specify the path to a nested project.</p><p>Use the forward slash character&nbsp;(<code>/</code>) to delimit project levels in the hierarchy. Use the backward slash (<code>\</code>), to escape instances of forward or backward slash characters in project names.</p><p>For example, for a project named Sandbox, in project Social, under top-level Marketing:</p><p><code>--project Sandbox --parent-project-path Marketing/Social</code></p></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>-u &lt;username&gt;</code></td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>--username &lt;username&gt;</code></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><p>Valid Tableau Server or Tableau Cloud user.</p></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>-p "&lt;password&gt;"</code></td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>--password  "&lt;password&gt;"</code></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><p>The password for the specified Tableau Server or Tableau Cloud user.</p></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1">&nbsp;</td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>--proxy-username &lt;username&gt;</code></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><p>The user name for a proxy server.</p></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyE-Column1-Body1">&nbsp;</td><td class="TableStyle-Basic-Border-BodyE-Column1-Body1"><code>--proxy-password "&lt;password&gt;"</code></td><td class="TableStyle-Basic-Border-BodyD-Column1-Body1"><p>The password for a proxy server.</p></td></tr><tr class="TableStyle-Basic-Border-Body-Body1"><td class="TableStyle-Basic-Border-BodyB-Column1-Body1"><code>-c "&lt;path and filename&gt;"</code></td><td class="TableStyle-Basic-Border-BodyB-Column1-Body1"><code>--config-file "&lt;path and filename&gt;"</code></td><td class="TableStyle-Basic-Border-BodyA-Column1-Body1"><p>Path and file name information for a file containing configuration options for the command. Always enclose the path in double quotation marks. For more information, see <a href="#Using" class="xref">Using a config file</a> below.</p></td></tr></tbody></table>

### Sample tableau addfiletoextract command

`C:\Program Files\Tableau\Tableau 2022.4\bin>tableau addfiletoextract --server https://online.tableau.com --username email@domain.com --password "OurServerPwd" --site vernazza --project "New Animations" --datasource "CurrentYrOverYrStats" --file "C:\Users\user2\Documents\DataUploadFiles\AprMay.csv"`

## Using a config file

You can use a plain text editor, such as Notepad or Text Edit, to create a config (configuration) file that you can use with `tableau refreshextract` or `tableau addfiletoextract`. A config file can be useful if you expect to update the same data source regularly over time. Instead of having to type the same options each time you run a command, you specify the config file. A config file also has the advantage of not exposing user names and passwords on the command line.

### Create the config file

For example, say you created a file called config.txt and saved it to your Documents folder. And in the file, you included the parameter information shown below.

For an extract from a hosted data source, published to Tableau Cloud, where **server** is **https://online.tableau.com**:

`server=https://online.tableau.com   site=vernazza   username=email@domain.com   password=OurPassword   project=New Animations   datasource=CurrentYrOverYrStats   source-username=database_user@hosted_datasource_provider.com   source-password=db_password`

### Reference the Config File from the Command Line

After you create the config file, you run the `tableau refreshextract` or `tableau addfiletoextract` command, pointing to the config file as the only option you use on the command line, and enclosing the config file’s path in double quotation marks. The syntax is as follows:

`tableau refreshextract --config-file "<path>"`

For example, to refresh the extract specified in the sample in the [Create the config file](#Create) section, you would run the following command (making sure that you are working in the bin directory for your version of Tableau Desktop):

`C:\Program Files\Tableau\Tableau 2022.4\bin>tableau refreshextract --config-file "C:\Users\user1\Documents\config.txt"`

### Syntax Differences for Config Files

The syntax for specifying options inside a config file differs from the syntax you use on the command line in the following ways:

- Option names do not begin with dashes or hyphens.
- You use an equals sign (with no spaces) to separate option names from option values.
- Quotation marks are not necessary (or allowed) around values, even when they include spaces (as for the `project` option in the example shown earlier).

## Use Windows Task Scheduler to Refresh Extracts

You can use Windows Task Scheduler, in combination with the Tableau Data Extract Command-Line Utility, to automate regular updates to Tableau Cloud data sources from within your corporate firewall. You can configure a task to occur once per day, week, or month, or after a specific system event. For example, run the task when the computer starts.

To learn more, see the [Task Scheduler How To...](http://technet.microsoft.com/en-us/library/cc766428.aspx) page in the Microsoft TechNet library.