Skip to main content

FastBCP 1.7.5: Export SQL Server Backups to Parquet on K3s and S3

Romain Ferraton
Romain Ferraton, ARPE.IO CEO
2026-12-03 · 11 min · Integration · FastBCP
1 030 000rows
Same count as SQL Server
full backup + 2 log backups
0.66s
Export, from the second run
1.9 s the first time, index kept on a volume
0SQL Server
In the cluster
and no database password
2Secrets
License and S3 keys
nothing secret in the Job
TL;DR

Your SQL Server already writes full and log backups to a share. With FastBCP 1.7.5, a Kubernetes Job reads them straight from that share, mounted read-only, and writes the table to Parquet on S3-compatible storage. We ran it on K3s with SeaweedFS: 1 030 000 rows, exactly what SQL Server holds after the last log backup, in 1.9 seconds, then 0.66 seconds once the index of the backups is kept on a volume. No SQL Server in the cluster, no restore, no database password: only the license and the S3 keys, in Kubernetes Secrets. Every command below was run as written.

Feeding a data lake from SQL Server usually means querying the production server, or restoring last night's backup somewhere first. Yet the data is already out of the server, every night and every few minutes: in its backups. And the pipelines that should use it run on Kubernetes, next to an S3-compatible store.

This article reads those backups as they are. FastBCP opens the .bak and .trn files from a shared volume, applies the log backups, and writes Parquet to SeaweedFS: from an empty machine with Docker to a DuckDB query on the result, in seven steps.

What's New in FastBCP 1.7.5​

Since FastBCP 1.6, --connectiontype backup_mssql reads a table from SQL Server full and differential backups, without restoring them. FastBCP 1.7.5 adds the log backups: name the .trn files in --database with the full backup, and the table comes out as it is at the end of the last log backup. Updates, deletes, new rows: the log is replayed, as a RESTORE would, with no SQL Server.

--database also accepts paths and ** for subdirectories. The image is on Docker Hub as arpeio/fastbcp:v1.7.5. See the 1.7 release notes.

The Lab​

The backup share
  • Written by SQL Server 2022
  • sales_full.bak, 14.3 MB, compressed
  • sales_log_1.trn and sales_log_2.trn
  • Mounted read-only in the cluster
K3s v1.34.1
  • One node, in a Docker container
  • The share as a PersistentVolume
  • Local-path storage for the index
SeaweedFS 4.56
  • S3 gateway on port 8333
  • A key pair limited to one bucket for FastBCP
  • Reachable from the laptop for DuckDB
FastBCP 1.7.5
  • Image arpeio/fastbcp:v1.7.5
  • One Kubernetes Job per export
  • License and S3 keys from Secrets

Step 1: The Backups​

The database sales is in the FULL recovery model. Its orders table goes through a day of work between three backups:

BackupTaken afterorders rows
sales_full.bakLoading 1 000 000 orders1 000 000
sales_log_1.trnMorning: 25 000 new orders, the first 1 000 orders shipped1 025 000
sales_log_2.trnAfternoon: 5 000 orders deleted, 10 000 new orders1 030 000

At the end, SQL Server counts 1 030 000 rows, 1 000 shipped orders and 35 000 new ones. These are the numbers FastBCP must find in the backups.

backups.sql: the database, the full backup and the two log backups
CREATE DATABASE sales;
GO
ALTER DATABASE sales SET RECOVERY FULL;
GO
USE sales;
GO
CREATE TABLE dbo.orders (
o_orderkey INT NOT NULL PRIMARY KEY,
o_custkey INT NOT NULL,
o_orderstatus CHAR(1) NOT NULL,
o_totalprice DECIMAL(15,2) NOT NULL,
o_orderdate DATE NOT NULL,
o_orderpriority CHAR(15) NOT NULL,
o_comment VARCHAR(79) NOT NULL
);
GO
WITH n AS (
SELECT TOP (1000000) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS i
FROM sys.all_objects a CROSS JOIN sys.all_objects b
)
INSERT INTO dbo.orders
SELECT i, i % 150000, 'O', (i % 50000) * 1.37,
DATEADD(DAY, i % 2557, '1992-01-01'), '3-MEDIUM', 'order ' + CAST(i AS VARCHAR(10))
FROM n;
GO
BACKUP DATABASE sales TO DISK = '/var/opt/mssql/backup/sales_full.bak' WITH COMPRESSION, INIT;
GO
-- Morning: new orders, and the first 1000 orders shipped
INSERT INTO dbo.orders
SELECT 1000000 + i, i % 150000, 'O', 99.99, '2026-12-02', '1-URGENT', 'new order ' + CAST(i AS VARCHAR(10))
FROM (SELECT TOP (25000) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS i FROM sys.all_objects a CROSS JOIN sys.all_objects b) n;
UPDATE dbo.orders SET o_orderstatus = 'F' WHERE o_orderkey <= 1000;
GO
BACKUP LOG sales TO DISK = '/var/opt/mssql/backup/sales_log_1.trn' WITH COMPRESSION, INIT;
GO
-- Afternoon: 5000 orders cancelled, 10000 more new orders
DELETE FROM dbo.orders WHERE o_orderkey BETWEEN 500001 AND 505000;
INSERT INTO dbo.orders
SELECT 1025000 + i, i % 150000, 'O', 49.99, '2026-12-03', '2-HIGH', 'new order ' + CAST(i AS VARCHAR(10))
FROM (SELECT TOP (10000) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS i FROM sys.all_objects a CROSS JOIN sys.all_objects b) n;
GO
BACKUP LOG sales TO DISK = '/var/opt/mssql/backup/sales_log_2.trn' WITH COMPRESSION, INIT;
GO

The three files sit in one folder of the share, here ./mssql-backups on the machine that runs K3s. SQL Server is not needed after this step.

Step 2: Start K3s with the Backup Share​

K3s is a complete Kubernetes in one binary. The rancher/k3s image runs it in Docker. We mount the backup folder on the node, read-only, and publish the S3 port of SeaweedFS for the last step:

docker run -d --name k3s --privileged --tmpfs /run --tmpfs /var/run \
-p 6443:6443 -p 8333:30833 \
-v "$PWD/mssql-backups:/srv/mssql-backups:ro" \
rancher/k3s:v1.34.1-k3s1 server --disable traefik --disable metrics-server

# Wait for the node, then get its kubeconfig
until docker exec k3s kubectl get nodes 2>/dev/null | grep -q " Ready"; do sleep 2; done
docker exec k3s cat /etc/rancher/k3s/k3s.yaml > k3s.yaml
export KUBECONFIG=$PWD/k3s.yaml

kubectl get nodes
NAME STATUS ROLES AGE VERSION
c5f45c00554d Ready control-plane 3s v1.34.1+k3s1
Good to know
  • On a Linux server, the K3s installer (curl -sfL https://get.k3s.io | sh -) runs the same cluster as a service, and the share is mounted like any other NFS or SMB share.
  • If kubectl answers x509: certificate signed by unknown authority, something on your machine inspects TLS on 127.0.0.1:6443: we met an antivirus web shield doing exactly that. Exclude the port, or run kubectl inside the node with docker exec -i k3s kubectl ….

Step 3: SeaweedFS as S3 Storage​

SeaweedFS is an open-source distributed file system with an S3 gateway. weed server -s3 starts the master, the volume server, the filer and the gateway in one process, which suits a lab or a small site.

Its S3 users are listed in a JSON file. FastBCP gets a key pair that can only read, write and list one bucket, arpeio-exports:

s3.json
{
"identities": [
{
"name": "fastbcp",
"credentials": [
{ "accessKey": "fastbcp-access-key", "secretKey": "fastbcp-secret-key-change-me" }
],
"actions": ["Read:arpeio-exports", "Write:arpeio-exports", "List:arpeio-exports"]
},
{
"name": "admin",
"credentials": [
{ "accessKey": "admin-access-key", "secretKey": "admin-secret-key-change-me" }
],
"actions": ["Admin", "Read", "Write", "List"]
}
]
}

The file holds secret keys, so it goes in a Secret too, mounted read-only in the SeaweedFS pod:

seaweedfs.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: seaweedfs
namespace: data
spec:
replicas: 1
selector:
matchLabels: { app: seaweedfs }
template:
metadata:
labels: { app: seaweedfs }
spec:
containers:
- name: seaweedfs
image: chrislusf/seaweedfs:latest
args:
- server # master, volume server and filer in one process
- -dir=/data
- -ip.bind=0.0.0.0
- -master.volumeSizeLimitMB=512 # small volumes for a test cluster
- -s3 # S3 gateway on port 8333
- -s3.config=/etc/seaweedfs/s3.json
ports:
- containerPort: 8333
volumeMounts:
- { name: s3-config, mountPath: /etc/seaweedfs, readOnly: true }
- { name: data, mountPath: /data }
volumes:
- name: s3-config
secret: { secretName: seaweedfs-s3 }
- name: data
persistentVolumeClaim: { claimName: seaweedfs-data }
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: seaweedfs-data
namespace: data
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 5Gi
---
apiVersion: v1
kind: Service
metadata:
name: seaweedfs
namespace: data
spec:
type: NodePort # S3 also reachable from outside the cluster
selector: { app: seaweedfs }
ports:
- { port: 8333, targetPort: 8333, nodePort: 30833 }
kubectl create namespace data
kubectl -n data create secret generic seaweedfs-s3 --from-file=s3.json
kubectl apply -f seaweedfs.yaml
kubectl -n data rollout status deploy/seaweedfs

# The bucket FastBCP writes to
kubectl -n data exec deploy/seaweedfs -- sh -c 'echo "s3.bucket.create -name arpeio-exports" | weed shell'

Step 4: The Backup Share as a Read-Only Volume​

A PersistentVolume describes the share, and a claim gives it to the Job. ReadOnlyMany: several exports can read the same backups at once, and none can change them.

mssql-backups-volume.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: mssql-backups
spec:
capacity:
storage: 100Gi
accessModes: [ReadOnlyMany]
persistentVolumeReclaimPolicy: Retain
storageClassName: ""
hostPath:
path: /srv/mssql-backups # the shared backup folder, as the node sees it
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mssql-backups
spec:
accessModes: [ReadOnlyMany]
storageClassName: ""
volumeName: mssql-backups
resources:
requests:
storage: 100Gi
kubectl apply -f mssql-backups-volume.yaml
kubectl get pvc mssql-backups # STATUS: Bound

On a cluster of several nodes, the PersistentVolume points to the share itself rather than to a folder of the node: nfs: with the server and the path, or the CSI driver of your SMB share or cloud file service. The claim and the Job do not change.

Step 5: The License and the S3 Keys in Secrets​

FastBCP reads files: no database user, no database password. Two Secrets are all it needs:

# The license file, as a file
kubectl create secret generic fastbcp-license --from-file=FastBCP.lic=./FastBCP.lic

# The S3 keys of the fastbcp identity, and the SeaweedFS endpoint
kubectl create secret generic fastbcp-s3 \
--from-literal=AWS_ACCESS_KEY_ID=fastbcp-access-key \
--from-literal=AWS_SECRET_ACCESS_KEY=fastbcp-secret-key-change-me \
--from-literal=AWS_REGION=us-east-1 \
--from-literal=S3_ENDPOINT=http://seaweedfs.data.svc.cluster.local:8333
SecretKeysHow the Job uses it
fastbcp-licenseFastBCP.licMounted as a read-only file under /secrets/fastbcp; its path goes to --license
fastbcp-s3AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, S3_ENDPOINTLoaded as environment variables: FastBCP reads them itself. S3_ENDPOINT points it to SeaweedFS instead of Amazon S3

Step 6: Run the Export Job​

The Job mounts three volumes: the license, the backups (read-only) and a small volume for the index of the backups. The first export from a backup reads its structure; FastBCP keeps the result in the directory named by FASTBCP_INDEX_DIR, and the next exports open the same backups much faster. On a volume, the index outlives the pod.

fastbcp-sales-orders-job.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: fastbcp-index
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 2Gi
---
apiVersion: batch/v1
kind: Job
metadata:
name: fastbcp-sales-orders
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
securityContext:
fsGroup: 10001 # group of the image user: the index volume is writable
fsGroupChangePolicy: OnRootMismatch
containers:
- name: fastbcp
image: arpeio/fastbcp:v1.7.5
env:
- name: FASTBCP_INDEX_DIR
value: /index
envFrom:
- secretRef:
name: fastbcp-s3
args:
- --license
- /secrets/fastbcp/FastBCP.lic
- --connectiontype
- backup_mssql
- --server
- /backups
- --database
- sales_full.bak;sales_log_*.trn
- --sourceschema
- dbo
- --sourcetable
- orders
- --fileoutput
- orders.parquet
- --directory
- s3://arpeio-exports/sales/orders/
- --parallelmethod
- Physical
- --paralleldegree
- "4"
- --runid
- sales_orders_from_backups
volumeMounts:
- name: fastbcp-license
mountPath: /secrets/fastbcp
readOnly: true
- name: backups
mountPath: /backups
readOnly: true
- name: index
mountPath: /index
volumes:
- name: fastbcp-license
secret:
secretName: fastbcp-license
- name: backups
persistentVolumeClaim:
claimName: mssql-backups
readOnly: true
- name: index
persistentVolumeClaim:
claimName: fastbcp-index
ArgumentWhy
--connectiontype backup_mssqlRead SQL Server backup files, with no SQL Server
--server /backupsThe directory of the backups: the mount of the share
--database sales_full.bak;sales_log_*.trnThe full backup and every log backup taken after it, in any order
--parallelmethod Physical, --paralleldegree 4Four threads, each reading a slice of the data pages, one Parquet file each
fsGroup: 10001The image runs as user fastbcp, uid and gid 10001: its group can write the index volume
kubectl apply -f fastbcp-sales-orders-job.yaml
kubectl wait --for=condition=complete job/fastbcp-sales-orders --timeout=300s
kubectl get job fastbcp-sales-orders
NAME STATUS COMPLETIONS DURATION AGE
fastbcp-sales-orders Complete 1/1 50s 53s

41 of these 50 seconds went into pulling the 215 MB image, the first time. The export itself took 1.9 seconds.

Step 7: Check the Result​

The Log​

kubectl logs job/fastbcp-sales-orders
... -|- INFORMATION -|- orders.parquet -|- Backup log : applied (adbc.arpemsbackup.restore_log=true): the tables are read as at the end of the log
... -|- INFORMATION -|- orders.parquet -|- Total data rows : 1030000
... -|- INFORMATION -|- orders.parquet -|- Total time : Elapsed=1941 ms
... -|- INFORMATION -|- orders.parquet -|- Completed Load

1 030 000 rows: the count of SQL Server after the second log backup. We ran the same Job a second time, then once with the full backup alone:

Run--databaseRowsFastBCP time
First runsales_full.bak;sales_log_*.trn1 030 0001 941 ms
Second run, index on the volumesales_full.bak;sales_log_*.trn1 030 000661 ms
Full backup alonesales_full.bak1 000 000716 ms

Without the .trn files, FastBCP reads the table as it was at the full backup, and says so in the log: Backup log : not applied.

The Parquet Files​

Four files, one per thread, 3.1 MB in all:

kubectl -n data exec deploy/seaweedfs -- sh -c 'echo "fs.ls -l /buckets/arpeio-exports/sales/orders" | weed shell'
-rwxrwx--- 1 seaweed seaweed 806896 /buckets/arpeio-exports/sales/orders/orders_chunk_000.parquet
-rwxrwx--- 1 seaweed seaweed 805922 /buckets/arpeio-exports/sales/orders/orders_chunk_001.parquet
-rwxrwx--- 1 seaweed seaweed 791744 /buckets/arpeio-exports/sales/orders/orders_chunk_002.parquet
-rwxrwx--- 1 seaweed seaweed 726639 /buckets/arpeio-exports/sales/orders/orders_chunk_003.parquet

The Data, with DuckDB​

The S3 port of SeaweedFS is published on the laptop: DuckDB reads the files where they are, with the same key pair as FastBCP.

INSTALL httpfs;
LOAD httpfs;
CREATE SECRET seaweedfs (
TYPE s3,
KEY_ID 'fastbcp-access-key',
SECRET 'fastbcp-secret-key-change-me',
REGION 'us-east-1',
ENDPOINT 'localhost:8333',
URL_STYLE 'path',
USE_SSL false
);

SELECT count(*) AS rows_now,
count(*) FILTER (WHERE o_orderstatus = 'F') AS shipped,
count(*) FILTER (WHERE o_orderdate >= '2026-12-02') AS new_orders
FROM 's3://arpeio-exports/sales/orders/*.parquet';
┌──────────┬─────────┬────────────┐
│ rows_now │ shipped │ new_orders │
│ int64 │ int64 │ int64 │
├──────────┼─────────┼────────────┤
│ 1030000 │ 1000 │ 35000 │
└──────────┴─────────┴────────────┘

The rows inserted, updated and deleted after the full backup are all there, as SQL Server sees them: the log backups were replayed.

From the Lab to Production​

The Job does not change. What is around it does:

In this labIn production
A folder of the node, as a hostPath volumeThe backup share itself: nfs:, or the CSI driver of your SMB share or cloud file service
SeaweedFS in the cluster, S3_ENDPOINTYour S3-compatible store (SeaweedFS, MinIO, Ceph…), or Amazon S3 without S3_ENDPOINT
Secrets created with kubectlSecrets from your vault, through External Secrets Operator, the Secrets Store CSI Driver or the Vault Agent Injector
One Job, run by handA CronJob after each log backup, with concurrencyPolicy: Forbid
arpeio/fastbcp:v1.7.5The version you have tested, pinned

Two more things the backups give you, with the same setup:

  • Encrypted backups (WITH ENCRYPTION) and full backups of TDE databases: FastBCP needs the private key of the server certificate. This is where a user and a password come back, as Secrets: the key file, mounted like the license, goes to --sourceuser, and its password to --sourcepassword as $(KEY_PASSWORD). See Encrypted backups.
  • Only what changed: rather than the whole table, read the changes committed in the log backups, for an incremental load. See The changes of a table.

Resources​