CKAN DataStore downloads: what a full table export gives your users
A portal team whose users want whole tables in Excel or in scripts needs a different tool from the paged Data API. The dump endpoint serves full DataStore downloads separately from paged API queries, so a user who wants every row receives the complete table in one file instead of stitching together pages of datastore_search results. Teams usually need full downloads when the table itself is the product: a published register, a statistical series or a reference list that analysts open in a spreadsheet or load into a pipeline without writing paging code. Paged queries suit applications that need a slice of rows. The dump suits people who want the whole file, and planning both paths on the same resource prevents support tickets from users who expect one to behave like the other.
A full download exists only after the resource has been loaded into the DataStore. An uploaded or linked file is just a file until a loader reads it and writes a table to the DataStore database. XLoader is the officially supported loader for this, and the legacy DataPusher should not be the basis for a new portal. Before you tell users a download is available, confirm on the dataset page that the resource shows as loaded and that the table holds the row count you expect. Check that the load used the file version users will see, because a failed or stale load leaves the download out of date with the source file, and users will not know unless you tell them.
This section is based on the CKAN DataStore documentation, which describes a separate PostgreSQL database with a write user and a read-only user, fronted by a Data API. Treat the endpoint names, parameters and format options here as a starting point, and confirm each one against the documentation for the CKAN version you run, since minor releases may include backwards-incompatible changes. Read the CKAN DataStore documentation for your version before you publish. Then test a full download of one large table in every format your users expect, open the CSV in Excel with accented characters in the data, and record the CKAN version and loader used so the result can be repeated after an upgrade.
Which format to offer for Excel, scripts and archives
CSV is the default offer for most readers. Analysts open it in Excel, data teams load it into pandas or R, and most open data users expect it. Its main risk is that it has no fixed meaning across software and regional settings, so the file is only as portable as the options used to write it.
- Who it suits: analysts and policy teams who open the file in Excel and want a quick look at every row, plus scripts that read delimited text.
- The bom option: a byte order mark at the start of a UTF-8 file tells Excel which encoding to use. Without it, accented names and non-Latin text can appear garbled when the file is opened by double-clicking on Windows.
- Delimiter and locale: in locales where the comma is the decimal separator, Excel often expects a semicolon between columns, so a comma-delimited file may open as a single column.
- Scripts: pandas, R and most database loaders read CSV without extra configuration once the delimiter and encoding match what the file contains.
- Very large resources: confirm how the dump endpoint handles your largest tables in your version before promising a full download to users.
Check by opening a sample download that contains accented text in Excel on Windows, and in a comma-decimal locale, before you publish it.
TSV carries the same rows as CSV but separates columns with tab characters. It suits teams whose text values rarely contain tabs and who want to avoid the comma and semicolon confusion that regional Excel settings cause. Its risks come from the data itself, because a tab or line break inside a value can shift columns for every reader downstream.
- Who it suits: teams importing into Excel in locales where the default list separator causes trouble, and tools that split records on tabs.
- Delimiter independence: the tab delimiter does not depend on the regional list separator, so the file splits into columns the same way on machines with different settings.
- Value escaping: review the source tables for tab and newline characters inside text fields. Those characters break the one-row-per-line structure that TSV readers expect.
- Encoding: the same encoding question applies as with CSV. Excel reads UTF-8 files more reliably when a byte order mark is present, so confirm whether the bom option applies to TSV in your version.
- Tool setup: many scripts and loaders need an explicit tab separator argument, so state the format and separator in the dataset description.
Check by loading a sample file with an accented text column into Excel and into a script, then confirming both read the same number of columns.
JSON suits developers and applications that consume records as structured objects. It keeps value types such as numbers and nulls more explicit than CSV and is easy to parse in most languages. It does not open cleanly in spreadsheet software without a conversion step, so it works best alongside a spreadsheet-friendly format rather than alone for non-technical audiences.
- Who it suits: application developers, web front ends and scripts that expect each record as an object keyed by column name.
- Structure: column names travel with every record, so consumers can read fields by name and are less affected when columns are reordered.
- File size: JSON repeats keys for every record, so the same table usually produces a larger file than CSV, which affects transfer time for large downloads.
- Type handling: confirm how numeric, date and null values are serialized in your version, and whether they match what the Data API returns for the same resource.
- Audience split: publish JSON next to CSV so that analysts and applications each have a format that opens without extra work.
Check by comparing a JSON download with the same rows from the Data API, including nulls and dates, using the CKAN DataStore documentation for your installed version to confirm the parameters.
XML suits archival and exchange workflows where a receiving system expects a document with a defined structure, which is common in government records and some regulated registries. It is verbose and is rarely the first choice for analysts, so it usually works best as a secondary format next to CSV. Confirm that your installed version offers it before you write it into a publication policy.
- Who it suits: archivists, records managers and partners whose ingest tools require XML input.
- Verbosity: element names repeat for every field in every record, so files are larger and slower to parse than CSV or JSON for the same table.
- Schema: XML is most useful when a published schema or profile applies to the export. Document which one applies, or state that none does.
- Encoding declaration: the file header declares an encoding, so confirm the declared encoding matches the bytes the endpoint serves, or receiving parsers will reject the file.
- Availability: format support differs between DataStore releases, so confirm XML availability and its parameters in the documentation for your installed version before promising it to partners.
Check by validating a sample export with the consuming system's parser and confirming it reads every record and the declared encoding.
CKAN DataStore download options and when each fits
This table compares the options a publisher or integrator can set on a CKAN DataStore full download, from file format and the CSV bom setting to field selection, filters, sort order and resource-level access. Read each row as a choice with a best fit and a cost, and confirm the parameter names against your CKAN version before you publish a download link. The main takeaway is that Excel-friendly output is an encoding decision, while filters and field choices change what consumers actually receive, so test each option with the tools your users open files in.
| Option | When it fits | Compatibility or load cost | Confirm on your CKAN version |
|---|---|---|---|
| Format (CSV, TSV, JSON, XML) | CSV for spreadsheet users, JSON or XML for systems that parse structured output | CSV and TSV carry no column types; JSON and XML are heavier to produce and read | Confirm which formats your dump endpoint accepts |
| CSV with bom enabled | Excel users on Windows who double-click files and see accented text | Adds a byte order mark that some parsers may read as part of the first column name | Confirm the bom parameter name and its default |
| CSV or TSV without bom | Scripts, R, pandas and database loaders that read UTF-8 directly | Excel may misread non-ASCII characters when a user opens the file by double-click | Confirm the default encoding of the dump output |
| TSV output | Values that contain commas, or tools that expect tab-separated input | Tabs or line breaks inside text values can break the column layout | Confirm that TSV is offered by your dump endpoint |
| Field selection | Smaller files for consumers who need only a few columns | Consumers that expect a fixed column set fail if fields change; load falls with fewer columns | Confirm the parameter name and whether the dump honors it |
| Filters on full downloads | Partial extracts such as one region or one date range | Filter syntax may differ from datastore_search, and a filter you expect may be ignored | Confirm which filters the dump endpoint accepts |
| Sort order | Files that must stay in a stable order for diffing or hashing | Sorting large tables adds database work to every download | Confirm sort support and whether it applies to full dumps |
| Resource-level access | Restricted resources that only some users may download | Anonymous consumers may receive errors or empty files; test with and without credentials | Confirm how dump access follows resource and dataset visibility |
How a dump request reaches the DataStore and returns a file
The request starts when a user or script calls the dump endpoint for one resource. The CKAN web application checks resource permissions first, so a denied request should stop before any database query runs. Allowed requests then use the read-only DataStore connection, the link that crosses the trust boundary into the separate DataStore PostgreSQL database. Returned rows go to the format writer, which produces CSV, TSV, JSON or XML, and the result comes back as a file response. When you review this path, confirm that downloads use the read-only user and that the permission check runs on every dump request.
Dump requests pass the permission check before any read-only query runs.
Why API queries and full downloads hit different row caps
A table can look complete through the Data API and still be cut short in a full download. Paged API queries and the dump endpoint are governed by different limits. The API caps how many rows a single request returns, so a client that pages through results experiences the cap as a page size. The dump endpoint is built for whole-table export and has its own controls, so a portal team that tests only the API has not tested the file an analyst opens in Excel. Treat the API and the download as two separate checks.
Start by looking up the row cap settings and any request timeout for your CKAN version in the DataStore documentation and your configuration file. Confirm which settings apply to search and which apply to the dump endpoint, because the names and scopes can differ between releases. Then test the largest table you publish. Download it through the dump endpoint, open the file, and compare the row count with a count from the source file or from a query run by your read-only database user. Note how long the download took and whether the web server, reverse proxy or load balancer in front of CKAN closed the connection first. A timeout at that layer can produce a file that ends early without any obvious error.
Next, confirm what a user sees when a download is cut short. Find out whether the dump returns an error, a partial file or a normal-looking file, and whether any notice reaches the person downloading it. Check the documentation for your version, and ask your implementation partner or CKAN contact to confirm the answer if the docs leave it unclear. The answer determines whether you need a warning on the dataset page, a size note or a fix before publication. If your portal adds customizations around the dump, retest them after each upgrade. Publishing the row count of each table on its dataset page also lets consumers check their own download against it.
Setting up and testing a DataStore download on a portal
This sequence confirms that a resource is loaded, that read-only access is in place, and that each download format opens correctly and returns the expected rows, including through the reverse proxy. The result is a tested set of download files and a short record of the checks, so the portal's download links are published with evidence behind them.
Confirm the resource is loaded
Start on the dataset's resource page in CKAN and confirm that the resource shows a DataStore tab or data preview with rows. A portal administrator or dataset editor can check this, and a load job that is still queued or has failed will show no table. Next, run a datastore_search call for the resource ID and confirm that it returns a total count and a field list. If the call returns no fields, resolve the load before continuing, because every later step depends on a populated table.
Verify the read-only connection and permissions
The public download and API path should use the read-only database user, which stays separate from the write user that CKAN uses to load data. Confirm that the read-only connection URL in the CKAN configuration is the one intended, and that
ckan datastore set-permissionshas been run for this database. Then test an anonymous download and a sysadmin download, and attempt a write through the read-only connection, which should fail. Keep the output of these tests as evidence for your security review.Request each format from the dump endpoint
Request the full table from the dump endpoint once for each format you publish: CSV, TSV, JSON and XML. Save each response to its own file in an empty folder, with the format in the file name so later checks are traceable. Confirm that each request returns a successful response with a body that is not empty, and that the CSV or TSV header line, or the JSON or XML structure, contains the expected column names. A format that returns an error or a truncated body goes back to the configuration step before the Excel checks begin.
Test the CSV with and without bom
Produce two CSV downloads of the same resource, one with the bom option set and one without it. Open each in Excel on a machine with your standard locale, then check accented names, currency symbols and any non-Latin text in a few known rows against the source file. The bom version should display those characters correctly on open, while the version without it may show garbled text in some locales. Excel versions and locales vary, so confirm the behavior on the versions your users run, then record which variant the download page should offer.
Compare row counts with the source file
Count the data rows in the source file, excluding the header line, and compare that number with the row count of each CSV, TSV, JSON and XML download. For JSON and XML, count the records in each file. Also compare the total returned by a datastore_search call for the same resource. The check is complete when all four downloads and the source show the same count, and any difference is traced to a load issue, a header row or a blank line before you move on.
Test the largest table through the proxy
Choose the largest table you publish and download it in every format through the public address, which is the same path users take through your reverse proxy. Confirm with your proxy's documentation that its timeout and response buffering settings allow a full response to arrive, and watch the proxy logs for upstream timeouts or truncated responses. Compare the row counts and file contents with direct downloads from the application server. The step is complete when the proxied files match the direct files and the proxy logs show no errors during the run.
Who can download what: permissions, private data and exports
Every CKAN DataStore download is another route to the same rows the portal describes, so the permission model has to hold on each path: the dataset page, the API, the dump endpoint and any copy that leaves the server. The cards below list what to verify before a portal exposes full table exports, from access checks to logs.
Resource permissions on private datasets
A private dataset is only private if every download path enforces it. Request the dump endpoint for a resource in a private dataset as an anonymous user, as a user outside the owning organization and as a collaborator, and confirm each response matches what the dataset page allows. Check the dump path separately from the dataset page, because a refusal on the page does not prove the file download is refused. Repeat the tests after changing a dataset from public to private.
Read-only export connection
Full dumps and API queries should read through the read-only DataStore user, so a fault in export code cannot write to or drop tables. Verify which connection string the web and worker processes use for downloads, and confirm the write user's password is absent from any service that answers public requests. Test the read role by attempting an insert through it and expecting the database to refuse. Confirm the grants against the DataStore setup steps for your CKAN version.
DataStore docsSensitive columns in full dumps
A full dump returns every column in the table, including columns that a search page, a map or a dataset view may never display. Before publishing, list the columns in each DataStore table and mark any that hold personal data, contact details, free-text notes or internal identifiers. Remove or separate those columns before the resource is loaded, then download the dump anonymously and compare its header row with your column review.
Cached and proxied copies
Downloads can outlive their permissions in copies. A reverse proxy cache, a CDN, a browser cache or a scripted mirror may keep a dump after a dataset is made private or deleted. Ask the operator of each layer which responses it caches, confirm that private resources bypass the cache, and test that a dataset changed to private stops being served from every layer. Include copies made by harvesters and downloads your team does not run.
Load from repeated large exports
A full dump streams the whole table on every request, so repeated downloads of large files compete with page views for the same web servers and database connections. Check whether dump requests share worker pools with the site, whether the proxy applies rate limits to the dump path, and who is allowed to trigger large downloads. Load test with your largest table and measure ordinary page response times while dumps run.
Logging of download activity
Web server access logs record each dump request with its path, status and client address, and those logs often outlive the dataset they describe. Confirm which fields your proxy and application log, who can read the logs, and how long they are kept. API tokens and session identifiers should never appear in a URL, because a token passed as a query parameter is written into access logs.
How to keep full downloads working after upgrades and data changes
Full downloads can change without anyone touching the portal. CKAN targets about two minor releases a year, and minor releases may include backwards-incompatible changes, while patch releases do not break backwards compatibility. Before any minor upgrade, read the release notes for the target version and check whether an extension touches DataStore or download code. Then run the same dump requests against a staging copy before and after the upgrade, and compare the output for a fixed set of resources. Compare the delimiter, encoding, the BOM added by the bom option, header names, and the JSON and XML structure, because a change in any of these breaks an Excel user or a script that parses the file. The CKAN release policy explains the support window for your current patch.
Table reloads cause the second kind of drift. When a publisher reloads a file through XLoader, the DataStore table is rebuilt from the new file, so row counts change and column types can shift. Illustratively, a numeric column can load as text once one value contains a letter, and users who sort, sum or join on that column may get wrong results without an error. Assign ownership before the first reload. The platform owner runs the upgrade check and the regression test after every CKAN upgrade. The data publisher runs the same check after each reload of a resource they own, and tells the users of that resource about column or row changes. Write both roles and their contacts into the runbook so that nobody has to guess who approves a changed download.
Large exports fail for reasons that a small test never shows. A proxy or load balancer in front of CKAN can close a long download before the dump finishes, and the web workers and temporary disk space used while streaming a large table can run short. Watch proxy timeout logs, disk and memory on the hosts that serve downloads, and the time a full dump of your largest table takes, and record that baseline. The regression test can be a short script that runs after each upgrade or reload. For a small, a medium and your largest resource, request each format from the dump endpoint, check the HTTP status and Content-Type, confirm the BOM is present when expected, compare the header row and row count with values stored in version control, and fail the run if the download does not finish within the timeout your proxy allows. Keep the expected values beside the script so that any change becomes a reviewed decision.
Limits to confirm before you promise full exports
Each card names a limit that can cut a download short, change what users see in Excel, or expose data the portal meant to restrict. Confirm each one in your own environment before you promise a complete export in a scope or service description.
Row cap and dump timeout
The dump endpoint streams a full table, so it runs under separate limits from the Data API queries your users try in the browser. Ask who set the row cap and the query timeout for the dump path, and whether a truncated dump announces itself or simply stops. Load a table larger than the cap and compare its row count with the source file. Record the answer in your scope, because the cap decides whether your documentation can call a download complete.
CKAN DataStore docsWeb server and proxy timeouts
A full export can take longer to stream than the timeouts in front of CKAN allow, and the browser may save a partial file without an error. Check the request timeouts in your uWSGI workers, the Nginx upstream and read timeouts, and any load balancer or CDN between users and the portal. Each layer can end the connection on its own clock. Test the download with your largest table through the same proxy path your users take. Compare the final row count with the source before you publish the link.
Excel row limits by version
Excel worksheets hold a fixed maximum number of rows, and the limit depends on the Excel version your users run. A complete CSV can still open incomplete in Excel. Older builds may drop rows without any warning to the person opening the file. Ask which Excel versions your audience uses, look up each version's row limit in Microsoft's current documentation, and open your largest file on the oldest version on that list. Tables above the limit need a split into several files or a JSON or XML download instead.
XML and JSON support
Which formats a dump offers depends on the CKAN version you run and on any extensions that alter the download path, so documentation may describe more than your deployment provides. Test each format on a live table before listing it in the scope. Include the XML and JSON outputs in that check. Then confirm that the consumers of those files accept the structure you produce, because a file that parses cleanly can still fail a downstream import.
Encoding and delimiters for European locales
Many European spreadsheet setups expect a semicolon as the field separator and a decimal comma, while a default CSV export may use a comma and a decimal point. Excel's choice of encoding and separator can depend on the byte order mark and the machine's locale settings. Confirm whether the dump offers a delimiter choice, and whether the bom option gives users the encoding they expect. Open a file with accented characters and decimal values on a machine set to a European locale. If only one delimiter is offered, plan a TSV option or a conversion step and state it in the scope.
Full exports on restricted resources
A dump reads the DataStore table directly, so the question is whether it honors the same permissions that govern the resource page and the Data API. Confirm who can download a full export: anonymous visitors, signed-in users, collaborators, or only administrators. Test with a private resource using an account without access, then with an API token from an account that has access. A full download promised on a restricted table can expose data the portal was meant to hide. Record the answer in the scope before the page goes live.
Questions teams ask before publishing full CKAN downloads
What drives the cost of full CKAN downloads, and who pays for each part?
The main cost drivers are the number and size of tables to publish, how clean their columns are, how many format and access rules apply, and how much testing your server and firewall need. DeployOpen's fee follows from the written scope and is not estimated here. Your organization carries the cost of infrastructure it already runs: the CKAN server, the PostgreSQL host, the cloud or data center capacity, and the staff time for approvals and business sign-off. The engagement scope typically covers planning, configuring the dump endpoint and format options, testing with your own files, documenting the behavior, and handover. Ask each quote to list the tables in scope, the formats offered per table, the test cases, and which work your team carries. Setup is mostly one-time cost, while upgrades and retesting recur when CKAN or the table structure changes.
How long do setup and testing usually take for full downloads?
Duration depends on how much work the scope contains, and the written scope is where the timeline is agreed before work starts. The main drivers are the number of DataStore tables and resources to publish, whether the columns are already typed or still loaded as text, and how many formats, access rules and file sizes need testing. Timelines also stretch when the CKAN version, the PostgreSQL host or the reverse proxy need changes, and when a server approval or change window sits outside the project's control. Testing takes longer when results must be checked by business owners who need to confirm the files open correctly in their tools. Ask for the timeline with its assumptions listed, including which dates depend on your approvals and access.
What must our team provide before a full download project starts?
Before work starts, your team needs to provide four things:
- A DataStore that is already loaded with the tables you plan to publish, so the dump endpoint has data to serve.
- Access to the CKAN server and its configuration, including shell access, the
ckan.inifile, and the database access your administrators approve for the project. - Test files and expected outputs, including a file with accented characters and your largest table.
- A named owner who makes decisions on format, access and acceptance, and who signs off test results.
Confirm each item in the written scope, since a missing owner or test file would block sign-off.
Can an in-house team set up full CKAN downloads without outside help?
Yes, if your team already runs CKAN and has the skills and time to own the change. The work is mostly configuration, testing and documentation, so an experienced CKAN administrator can carry it out internally. Check these skills before deciding: Linux administration, PostgreSQL, CKAN configuration, web server settings and repeatable test cases. Outside help is most useful when the team lacks spare capacity, when the tables need cleanup first, or when the portal needs an independent test before publication. Whichever route you choose, name an owner who will retest after each CKAN upgrade, since changes between versions can affect downloads.
How do row caps and large-file timeouts change a full download plan?
Row caps and timeouts decide whether a full download finishes at all, so they belong in the plan from the start. The API caps rows for queries, and full downloads follow their own limits, so a table can pass API tests and still fail as a file. Check the configured limits in your ckan.ini and the web server, proxy and worker timeouts, since any of them can cut a large export short. Options to discuss include splitting a very large table, publishing a reduced column set, or delivering the full file another way. Test the largest table through the same server, proxy and network path that public users will use, and record the time and file size for each format.
Can a full download expose private resources that the API hides?
It can, if the download route is not tested as carefully as the API, so confirm access rules on your CKAN version before publishing. A download link is a separate route, so it needs its own test with private datasets, private resources and draft records. Test with an anonymous visitor, a user outside the owning organization, a collaborator and a sysadmin, and compare what each sees through the API and the dump URL. Confirm the read-only DataStore user and resource-level settings against the DataStore documentation for your version. If a test fails, fix the permission before sharing any public link, and retest after each CKAN upgrade.
Why does a CSV open with garbled characters in Excel, and what does bom change?
Excel may guess the wrong encoding for a CSV file that contains UTF-8 text without a marker, so accented names and symbols can display incorrectly. The bom option adds a byte order mark at the start of the file, which signals UTF-8 to Excel. It is a small change, but it must be tested with your own data, since some other tools may show the marker as stray characters. Check that the separator matches what your users expect, because Excel's regional settings can change how commas and decimals are read. Give users a short guide on opening the file, and record the test results in the handover notes.
How DeployOpen scopes, delivers and supports CKAN downloads
DeployOpen treats CKAN DataStore downloads as part of the portal's public data contract, so the full-table dump, the CSV encoding choice, the other output formats and the row limits are agreed before anything is built. Work happens in the client's own CKAN installation, with the DataStore loader, the read-only database access and the download behavior tested against the files people actually open in Excel. Engagements are fixed-scope, and the written scope names each format and endpoint covered.
How we scope
- The written scope names each download format, such as CSV, TSV, JSON or XML, and the resources it covers.
- It states whether CSV output includes the Excel-friendly byte order mark and who verifies it opens cleanly.
- Fixed-scope engagements are agreed in writing before work starts, and ongoing support is available as a retainer.
How we build
- Configure the DataStore dump endpoint and any proxy or web server limits that affect large full-table downloads.
- Separate row caps for API queries from full downloads, and test each path against the largest tables published.
- Test CSV, TSV, JSON and XML output with Excel, LibreOffice and a script that reads the files.
How we hand over
- Written documentation of the download URLs, formats, encoding choices and row limits for each published resource.
- A short runbook for portal staff covering how to confirm a full download after a resource is reloaded.
- Notes on which CKAN version and loader each setting was checked against, so upgrades can be reviewed.
How we support
- Retainers cover ongoing support, upgrades and continuous testing of CKAN and its DataStore behavior.
- Upgrades are reviewed against CKAN's patch and minor release policy, since minor releases may change behavior.
- Changes to download formats or row limits are retested after each CKAN upgrade, extension update or loader change.

