Amazon Redshift Import / Export Command Line
Load SQL Server, MySQL, Oracle or flat files into Redshift with one command.
aws.exe redshift extracts your data, splits and compresses it, stages it in Amazon S3 and runs the Redshift COPY for you, in parallel. The same tool exports Redshift tables to CSV, JSON, Excel or PDF and runs SQL scripts, so a whole warehouse job fits in one batch file.
Fully functional for 30 days. Redshift is in the For AWS and Standard licenses.
- Single EXE for Windows
- Runs on your machine
- ODBC, OLE DB and ADO.NET sources
- Fully functional 30-day trial
REM Copy last night's orders from SQL Server into Redshift C:\jobs> aws.exe redshift import Db --source-driver ADONET_MSSQL --source-query "select * from dbo.Orders where OrderDate >= '2026-11-15'" --source-connstr "Data Source=sql01;Initial Catalog=Sales;Integrated Security=SSPI;" --target-table "orders" --target-stagepath "acme-stage/redshift" --maxthreads 8 --maxrows-perfile 100000 --logfile "C:\logs\orders.txt" --region us-east-1 --accesskey AKIA•••••••• --secretkey •••••••• --target-connstr "Host=dw.••••.redshift.amazonaws.com;Port=5439;Database=dw;UserName=etl;Password=••••;EnableSsl=true;"
Trusted by data teams worldwide
Also rated on ★★★★★,
★★★★★ and
A+
At a glance
What the Redshift command line can do
The steps of a Redshift load (extract, split, compress, upload to S3, COPY, clean up) in one command, plus export and SQL execution.
Load from any database
Run a SQL query against the source and land the rows in a Redshift table.
- SQL Server, MySQL, Oracle and any ODBC, OLE DB or ADO.NET source
--source-driverand--source-query
Load flat files
Load local CSV or delimited files, including ones that are already gzipped.
import File --source-path "C:\data\*.csv"--source-compressedfor*.gzfiles
Fast parallel loads
Millions of rows in minutes, using Redshift’s own bulk COPY path.
- Splits data with
--maxrows-perfile - Uploads in parallel with
--maxthreads - Gzips files before transfer by default
Client-side encryption
Encrypt staged files before they leave your machine.
--enc-keywith an AES 256 key file- Redshift decrypts during COPY
Control the load
The COPY options you need for messy real-world data.
--target-truncate,--maxerrors,--dateformat--testloadvalidates without loading
Clean up as you go
Leave no stray files on disk or in the S3 stage.
- Delete or move source and stage files after the load
--logfilekeeps a record of every run
Export Redshift data
Pull a table or query out to a file people can open.
--csv,--json,--excel,--pdf,--html- Split by size or rows;
--groupbyfor one file or tab per value
Run SQL scripts
Create, drop or update tables before and after a load.
sqlexec --sqlfor one statementsqlexec --script-filefor a whole script
See all features
- Import from a SQL query over ODBC, OLE DB or ADO.NET, or from local files
- Split large extracts with
--maxrows-perfileand upload them in parallel - Automatic gzip compression before transfer (
--no-compressto turn it off) - Load files that are already compressed (
--source-compressed) - Client-side AES 256 encryption of staged files
- Truncate the target first, or use the fast truncate option
- Header rows, column delimiter, quoted values, null and blank handling
- Date format, invalid characters, truncate-to-fit and max error controls
- Test mode that validates a load without loading it
- Delete or move source files and S3 stage files after the load
- Update table statistics after the load
- Export to CSV, JSON, XML, Excel, PDF or HTML, with split and group-by options
- Run single SQL statements or script files with
sqlexec - Log file and console output to a file for every run
How it works
From source to Redshift table, one command each.
The jobs most teams schedule, with the exact syntax you paste into a batch file.
Query a database and load the result.
import Db runs --source-query over the driver you pick, writes the rows to staged files, uploads them to --target-stagepath in S3 and loads --target-table.
--target-truncate empties the table first for a full reload; leave it off to append.
- ADO.NET, ODBC or OLE DB drivers
- Stage files deleted after the load
C:\jobs> aws.exe redshift import Db --source-driver ADONET_MSSQL --source-query "select * from dbo.Customers" --source-connstr "Data Source=sql01;Initial Catalog=Sales;Integrated Security=SSPI;" --source-stagepath "C:\redshift\stage" --target-table "customers" --target-truncate --target-stagepath "acme-stage/redshift" --source-stage-archivemethod Delete --target-stage-archivemethod Delete --region us-east-1 --accesskey AKIA•••• --secretkey •••• --target-connstr "Host=dw.••••.redshift.amazonaws.com;Port=5439;Database=dw;UserName=etl;Password=••••;EnableSsl=true;"
Load a folder of CSV files.
import File takes a wildcard --source-path. Add --source-recursive for subfolders and --source-compressed when the files are already *.gz.
--source-archivemethod Move with --source-archivefolder files away what was loaded, so the next run starts clean.
--firstrow-has-colnamesand--coldelimiter--testloadchecks the load first
C:\jobs> aws.exe redshift import File --source-path "C:\data\files\*.csv" --firstrow-has-colnames --source-archivemethod Move --source-archivefolder "C:\data\loaded" --target-table "web_events" --target-stagepath "acme-stage/events" --maxrows-perfile 100000 --logfile "C:\logs\events.txt" --region us-east-1 --accesskey AKIA•••• --secretkey •••• --target-connstr "Host=dw.••••.redshift.amazonaws.com;Port=5439;Database=dw;UserName=etl;Password=••••;EnableSsl=true;"
See every step as it runs.
The console reports each stage of the load (extract, split, compress, upload to S3 and the Redshift COPY) in color, so a failed step is easy to spot.
Add --logfile to keep the same output for scheduled runs.

Get data back out, and run SQL around a load.
export writes a table or query to CSV, JSON, Excel, PDF or HTML. --split --splitsize 10mb breaks large output into parts, and --groupby with --excel-split-ontab puts each value on its own Excel tab.
sqlexec runs one statement with --sql or a whole script with --script-file.
C:\jobs> aws.exe redshift export "select * from customers" -o C:\out\customers.csv --csv --split --splitsize 10mb -y --connstr "Host=dw.••••;Port=5439;Database=dw;UserName=etl;Password=••••;EnableSsl=true;" C:\jobs> aws.exe redshift sqlexec --script-file "C:\sql\rebuild-staging.sql" --connstr "Host=dw.••••;Port=5439;Database=dw;UserName=etl;Password=••••;EnableSsl=true;"
Command reference
Three commands cover the warehouse job.
Each link opens the full option list and more examples in the online help.
Load
import Dbquery a database and bulk load the rowsimport Filebulk load local or gzipped files
Export
exporttable, view or query to CSV, JSON, XML, Excel, PDF or HTML
Run SQL
sqlexecone statement or a script file (DDL or DML)
Articles
Worked examples that use the Redshift command line.
Editions
Try it for 30 days. Pay once when it works.
Licenses are perpetual, per machine, with one year of support and upgrades.
Trial
$0 for 30 days
Every Redshift option, fully working, on your own data.
- import, export and sqlexec
- Keep it running with a For AWS or Standard key
- Help from an engineer during the trial
For AWS S3 + Redshift
$499 per machine
Redshift import, export and SQL, plus the Amazon S3 command line.
- Redshift import, export and sqlexec
- 20+ Amazon S3 file and bucket commands
- Premium support by phone or web meeting
Standard All 4 tools
$599 per machine
Every ZappyShell tool on one key.
- Amazon Redshift and S3
- Azure Blob Storage
- Database export to JSON, CSV, Excel and PDF
- Premium support by phone or web meeting
Requirements
Built for Windows scripts and schedulers.
- Windows desktop and server, from the Command Prompt or PowerShell
- An Amazon Redshift cluster and an S3 bucket for staging files
- Source data over ODBC, OLE DB or ADO.NET drivers, or local files
- Schedule with Task Scheduler, SQL Server Agent or an ETL tool such as Informatica, Pentaho or DataStage
- Fully functional 30-day trial
FAQ
Questions teams ask before they script Redshift loads.
How do I load SQL Server, MySQL or Oracle data into Redshift?
Use aws.exe redshift import Db with a --source-query and the driver for your database (ADO.NET, ODBC or OLE DB). ZappyShell extracts the rows, stages them in S3 and runs the Redshift COPY in one command.
Why does the load go through Amazon S3?
The COPY command is Redshift’s fast bulk-load path, and it reads from S3. ZappyShell splits and compresses the data, uploads it to your staging path, loads it and can delete the staged files afterwards.
Can I load files that are already gzipped?
Yes. Use import File with --source-compressed. Uncompressed files are gzipped automatically before upload unless you add --no-compress.
Can I test a load without changing the table?
Yes. --testload validates the whole load without loading any rows, and --maxerrors sets how many bad rows a real load may skip.
Can I call it from Informatica, Pentaho or my own code?
Yes. aws.exe is a normal Windows program, so any tool that can start a command can run it: Informatica PowerCenter, Pentaho, DataStage, SQL Server Agent, Task Scheduler, or Ruby, Python and C# code.
How is it licensed?
Licenses are perpetual and per machine, with one year of support and upgrades. For AWS ($499) covers Redshift and Amazon S3; Standard ($599) adds Azure Blob Storage and database export.
Free 30-day trial
Download ZappyShell and run your first Redshift load today.
One install gives you aws.exe, azure.exe and db.exe.
- Fully functional for 30 daysimport, export and sqlexec on your own data.
- Runs on your machineCredentials and data stay in your environment.
- Live supportTalk to an engineer during your trial.
Open Help FileZappyShell overview
New purchases may be eligible for refund review within 30 days. See the refund policy.
Talk to an engineer before or during your trial.