# Export rekordbox playlists to a USB stick without opening rekordbox

**You can write a USB stick for CDJs without launching rekordbox.** A player reads a stick through a handful of files: the Device Library (`export.pdb`), a set of analysis files for each track, the audio and your My Settings. rekordbox normally writes them when you export in EXPORT mode. **`baken expressport`**, part of the free `baken` command line, writes the same files straight from the `collection.xml` rekordbox exports, and the **USB Export** page in Bake'n Deck for Mac runs the same code in a window. Your prep stays in rekordbox. Analysis, beat grids, cues and playlists are made there as always, and only the last step, writing the stick, happens elsewhere.

## Before you start

- **Device Library by default.** Players that need OneLibrary (CDJ-3000X, XDJ-AZ, OPUS-QUAD, OMNIS-DUO) get it with `--onelibrary` (command line, since 4.5.0) or Write OneLibrary too (Mac app, since 1.3.0), which no such player has read yet; without it a CDJ-3000X shows "OneLibrary not found". Sticks written by `expressport` have played on a CDJ-3000 and on CDJ-2000NXS2 players
- **rekordbox's database is never read or written.** The export reads the collection XML and rekordbox's analysis files, and writes only to the stick
- **Give it a stick of its own.** rekordbox rewrites a library it opens, so keep one stick for rekordbox and another for baken
- **Check the stick on a player before a gig**, as you would with any stick

## What a CDJ reads from a stick

| On the stick | What the player gets from it |
| --- | --- |
| `PIONEER/rekordbox/export.pdb` | The Device Library: each track's title, artist, album, BPM, key, colour, rating and file path, and the playlists. The browse screen and search read this |
| `PIONEER/USBANLZ/…/ANLZ0000.DAT`, `.EXT`, `.2EX` | The analysis of one track: beat grid, waveforms, cues and loops, phrases. The player finds the folder from a hash of the track's path on the stick |
| `Contents/` | The audio files |
| `PIONEER/Artwork/` | Artwork thumbnails. baken writes them with `--artwork` |
| `PIONEER/MYSETTING.DAT`, `MYSETTING2.DAT`, `DJMMYSETTING.DAT` | My Settings: the player and mixer preferences a CDJ loads from the stick, waveform colour among them |
| `PIONEER/rekordbox/exportLibrary.db` (with `-wal`, `-shm`) | OneLibrary, a second library rekordbox 7 writes for the players that read it. baken writes it only with `--onelibrary` (in the Mac app, Write OneLibrary too) |
| `PIONEER/rekordbox/exportExt.pdb` | rekordbox's extension tables for its Device Library. baken does not write it |

None of this comes from the audio alone. `export.pdb` is a binary database in AlphaTheta's own format, and the analysis files are rekordbox's analysis of each track, rewritten for the stick at export time. rekordbox builds both from its own library. That is why an export normally means launching rekordbox, switching to EXPORT mode and waiting while it copies.

## How baken writes it from collection.xml

rekordbox exports its whole collection as XML with File → Export Collection in xml format. That file holds nearly everything the Device Library needs, and baken builds the stick from it:

- **From the XML**: title, artist, BPM, key, colour, rating, playlists, beat grid and cues. The key shows on the player the way the XML spells it, `Am` as `Am` and `8A` as `8A`, as on a stick rekordbox exports
- **Copied from rekordbox**: the waveforms and phrases, from the analysis rekordbox keeps on your computer (`~/Library/Pioneer/rekordbox/share/PIONEER/USBANLZ` on a Mac, or `PIONEER/Master/share/PIONEER/USBANLZ` on a library drive). On the way the path is rewritten, the cues are filled in from the XML and the phrase data is masked, exactly as rekordbox does at export time. Tracks rekordbox never analysed are listed and left out
- **My Settings** are copied from rekordbox's settings folder, where rekordbox writes them once Preferences → DJ System → My Settings has been opened in EXPORT mode. Leave them out and the player keeps its own settings
- **Audio** is copied only when it is missing from the stick or differs in size, so a second run after a playlist change is quick. `export.pdb` is rebuilt on every run
- The result is byte-checked against real rekordbox exports (design record: [#115](https://github.com/M-Igashi/baken/issues/115))

Tracks rekordbox has never seen, such as a Mixxx or Traktor library converted to `collection.xml`, can have their analysis generated from the audio instead: `--generate-analysis` on the command line, Generate missing analysis in the Mac app.

|  | Copied (the default) | Generated |
| --- | --- | --- |
| Source | rekordbox's own analysis files | Computed from the audio by baken |
| Beat grid and cues | From the XML | From the XML. A track with no `TEMPO` in the XML gets no beat grid |
| Waveforms | rekordbox's own | The scrolling waveform matches rekordbox's to the pixel on the tracks checked; the colour, three-band and preview waveforms are close approximations |
| Phrases | rekordbox's own | None |
| Played on CDJs by testers | ✓ | ✓ |

A track that has a rekordbox analysis is copied even with generation on, because copying is exact.

## Format the stick: FAT32 on a Master Boot Record

Format the stick as **FAT32 with a Master Boot Record (MBR) partition table**, the one combination every player reads. A CDJ-2000NXS2 or older reads neither exFAT nor a GPT disk and does not show such a stick at all. (The players' manuals also list FAT16 and HFS+.)

| Stick | CDJ-2000NXS2 and older | CDJ-3000 |
| --- | --- | --- |
| FAT32, MBR | ✓ | ✓ |
| exFAT | ✗ | ✓ |
| GPT partition table | ✗ | ✗ (AlphaTheta lists it as unsupported) |
| NTFS | ✗ | ✗ |

On a Mac, open Disk Utility, choose View → Show All Devices, select the stick itself rather than its volume, and Erase it with Format MS-DOS (FAT) and Scheme Master Boot Record. In Terminal, `diskutil eraseDisk FAT32 MYUSB MBRFormat /dev/diskN` does the same. Find N with `diskutil list` first, because the wrong number erases the wrong disk. `expressport` (on macOS and Linux) and the Mac app's pre-flight read the stick's filesystem and partition table before writing, and warn when they rule out a player.

## Which players

| Player | Library it reads | A stick written by baken |
| --- | --- | --- |
| CDJ-3000 | Device Library | ✓ Played, firmware 3.22 |
| CDJ-2000NXS2 | Device Library | ✓ Played, firmware 1.85 and 1.87 |
| XDJ-XZ and older Device Library players | Device Library | Same format, no player report yet |
| CDJ-3000X, XDJ-AZ, OPUS-QUAD, OMNIS-DUO | OneLibrary | Written with `--onelibrary` (4.5.0) or the Mac app's Write OneLibrary too (1.3.0), no player report yet (without it, CDJ-3000X: "OneLibrary not found") |

On the CDJ-3000 and the CDJ-2000NXS2, testers checked playlists, beat grid, waveforms, cues, keys, search and My Settings, with copied and with generated analysis, on libraries of up to 1,121 tracks ([#116](https://github.com/M-Igashi/baken/issues/116), where reports on other players are welcome). Those sticks were written by the command line; the Mac app runs the same export code. Players older than the NXS2 are only dependable with MP3: `--cdjsafe`, CDJ Safe in the Mac app, converts every track to 320 kbps CBR MP3 on the way and keeps the source track's analysis.

## rekordbox 7: "We have found a library inconsistency on the device you are using"

rekordbox 7 can show this when a stick is attached, followed by two lists, *Playlists found only in Device Library* and *Playlists found only in OneLibrary*, and an offer to export the playlists that differ. It means the stick carries two libraries that no longer agree.

### Why it happens

rekordbox 7 writes two libraries on a stick, side by side in `PIONEER/rekordbox`. The **Device Library** (`export.pdb` and `exportExt.pdb`) is what the CDJ-3000, the CDJ-2000NXS2 and older players read. **OneLibrary** (`exportLibrary.db`, with `exportLibrary.db-wal` and `exportLibrary.db-shm` next to it) is what the CDJ-3000X, XDJ-AZ, OPUS-QUAD and OMNIS-DUO read. Each keeps its own copy of the playlists, so when something rewrites one and leaves the other, the two disagree. On our side that was `baken expressport` up to 4.3.1: it replaced `export.pdb` on a stick rekordbox had exported to and left rekordbox's OneLibrary and `exportExt.pdb` where they were ([#208](https://github.com/M-Igashi/baken/issues/208)).

### What it breaks

- rekordbox flags the stick. Accept its offer and it writes its own playlists back onto the stick
- OneLibrary players read `exportLibrary.db`, so they show the old library rather than the one written last. If old files were pruned since, its tracks can point at audio that is gone
- What a player makes of a stale `exportExt.pdb` next to a newer `export.pdb` is not known, and neither is which of the two libraries a CDJ-3000 reads when a stick carries both

### How to fix it

| The stick is | Fix |
| --- | --- |
| Exported by rekordbox, and stays a rekordbox stick | Let rekordbox write both libraries again: export the playlists again from rekordbox (accepting its offer does that for the ones that differ). For a clean start, format the stick as FAT32 on MBR and export from rekordbox |
| Written by baken | Run the export again with baken 4.4.0 or later, or Bake'n Deck for Mac 1.2.0. It removes the stale OneLibrary files once `export.pdb` is written. By hand, delete `exportLibrary.db`, `exportLibrary.db-wal`, `exportLibrary.db-shm` and `exportExt.pdb` from `PIONEER/rekordbox`. Accepting rekordbox's offer on this stick would write rekordbox's playlists onto it |

Since 4.4.0, `expressport` lists those files in its plan, and in `--dry-run`, before anything is written. It removes them only after `export.pdb` is written, so a cancelled or failed run leaves both libraries as they were. The Mac app names them in its pre-flight and asks before it replaces the library. A CDJ-3000X then shows "OneLibrary not found" rather than the old library, unless the command line ran with `--onelibrary`, which writes a new OneLibrary in their place. The warning can come back if rekordbox opens the stick again, because rekordbox rewrites a library it opens (see the questions below).

## How to export to USB without opening rekordbox

1. **Prep in rekordbox and export the XML**
Analyse the tracks and set beat grids, cues and playlists in rekordbox as usual, then File → Export Collection in xml format. Save it to the same path every time, for example ~/Music/rekordbox/collection.xml.
2. **Format a stick of its own**
FAT32 with a Master Boot Record partition table, so every player reads it. Keep it separate from the stick rekordbox exports to.
3. **Run the export**
On the command line: baken expressport ~/Music/rekordbox/collection.xml --device /Volumes/MYUSB --playlist "Sets/Friday". In the Mac app: open USB Export, choose the XML and the stick, tick the playlists and Validate, read the pre-flight, then Export.
4. **Eject and check it on a player**
Before the gig, put the stick in a player and look at the playlists, waveforms, beat grid, cues and search. Check it on the player rather than in rekordbox, which rewrites a library it opens.
5. **Run it again after a change**
When playlists change, export the XML again and run the same export. Only new audio and changed analysis files are written; export.pdb is rebuilt every run.

```
# Terminal: expressport
$ baken expressport ~/Music/rekordbox/collection.xml --device /Volumes/MYUSB --playlist "Sets/Friday"
▸ Device: /Volumes/MYUSB (name MYUSB)
▸ Playlists: Sets/Friday
▸ Tracks: 62 (3312 analysis files indexed under ~/Library/Pioneer/rekordbox/share/PIONEER/USBANLZ)
▸ My Settings from ~/Library/Application Support/Pioneer/rekordbox6
✓ Done! 62 tracks in the device library.
• 62 audio files copied
• 186 analysis files written
• /Volumes/MYUSB/PIONEER/rekordbox/export.pdb
• 4 My Settings files in /Volumes/MYUSB/PIONEER/
$ baken expressport ~/Music/rekordbox/collection.xml --device /Volumes/OLDSTICK --playlist "Sets/Friday" --dry-run
▸ Device: /Volumes/OLDSTICK (name OLDSTICK)
⚠ This stick also carries rekordbox's OneLibrary (exportLibrary.db, exportLibrary.db-wal, exportLibrary.db-shm, exportExt.pdb). expressport writes the Device Library only, so writing export.pdb removes them. OneLibrary players (CDJ-3000X, XDJ-AZ, OPUS-QUAD, OMNIS-DUO) will then show "OneLibrary not found" instead of rekordbox's old library.
▸ Playlists: Sets/Friday
ℹ Dry run; nothing written.
```

### Flags worth knowing

| Flag | What it does |
| --- | --- |
| `--playlist PATH` | A playlist to export; repeat it for more. Without it, every playlist in the XML |
| `--dry-run` | Resolve and report, write nothing |
| `--generate-analysis` | Compute the analysis from the audio for tracks rekordbox never analysed |
| `--cdjsafe` | 320 kbps CBR MP3 for every track (needs ffmpeg) |
| `--no-settings` | Write no My Settings; the player keeps its own |
| `--prune` | Delete audio and analysis on the stick that this export no longer references |

`baken expressport --help` lists them all. Installation is on the [front page](https://baken.ravers.workers.dev/#install).

## USB Export in Bake'n Deck for Mac

The USB Export page in [Bake'n Deck for Mac](https://apps.apple.com/app/baken-deck/id6808813823) (1.2.0 and later) runs the same export code in a window, for DJs who would rather not open a Terminal.

- Choose the collection XML and the stick itself (for example `/Volumes/REKORDBOX`), tick the playlists and Validate. The first time, the app asks for access to rekordbox's analysis folder, and to its settings folder when My Settings are copied. It remembers both
- The pre-flight shows the stick's format (with a warning for exFAT, NTFS or a GPT disk), the tracks that will be skipped and why, how much audio will be written and roughly how long it will take. On a stick rekordbox exported to, it names the OneLibrary files that will be removed
- Options: CDJ Safe (320 kbps CBR MP3 on the way), Generate missing analysis, Copy My Settings and Remove old files. The last three stay off until you turn them on
- If the stick carries a library the app did not write last, or rekordbox's OneLibrary files, a dialog asks before the library is replaced and says that the OneLibrary files go too
- The report counts the audio files copied, converted and already on the stick, the analysis files written, and the rekordbox library files removed. Reveal and Eject follow the run, and a re-run writes only what changed

## How long it takes

An export runs at the stick's write speed plus about 0.4 s per track, which is what a FAT32 stick takes to create the folder and the three analysis files the format wants for each track (measured on macOS 26: a new directory 150 ms, a file create 27 ms, a write and close 25 ms).

- A USB 3 stick that writes 25 MB/s needs about 40 s per GB
- Many sticks slow down once warm. A 62-track, 3.3 GB playlist took 339 s on a cold stick and about 450 s later; copying the same files with `cp -R` took 410 to 533 s
- `--cdjsafe` adds the encoding, a few seconds per track
- A second run copies only new or changed audio, so it is much quicker
- On Linux, check the mount options: udisks2 mounts FAT sticks with `flush`, which sends every closed file to the device at once, and cheap sticks are slow at that ([#173](https://github.com/M-Igashi/baken/issues/173))

The Mac app's pre-flight estimates a little more conservatively, about half a second per track.

## Frequently asked questions

### Does this touch my rekordbox library?

No. baken never reads or writes rekordbox's own database. It reads the collection XML you export from rekordbox, copies rekordbox's analysis files and My Settings, and writes only to the stick. Your prep stays in rekordbox, and so does the management of your library.

### Is this a replacement for rekordbox?

No. Analysis, beat grids, cues and playlists are made in rekordbox, and the waveforms on the stick are rekordbox's own analysis files, copied. baken only takes over the last step, writing the stick, from the collection XML rekordbox exports. Where rekordbox is still the safer route, such as a gig stick for a OneLibrary player, this guide says so.

### Does it work with the CDJ-3000X, XDJ-AZ, OPUS-QUAD or OMNIS-DUO?

Not confirmed yet. Those players read OneLibrary (exportLibrary.db) instead of the Device Library (export.pdb). Since baken 4.5.0 the command line also writes OneLibrary with --onelibrary, but no such player has read one yet, so please report what yours shows in issue #139 on GitHub. The Mac app does the same with Write OneLibrary too, since 1.3.0. Without either, the stick carries the Device Library only, and a CDJ-3000X shows OneLibrary not found. Until reports come in, export a gig stick for those players from rekordbox.

### Can I use the same stick with rekordbox too?

No. Give baken a stick of its own. rekordbox rewrites a device library it opens, and even changes a stick that is only mounted while it runs: rbsync measured it deleting 768 of 5,825 playlist entries from a stick it opened and adding an exportLibrary.db. Check a baken stick on a player, not by opening it in rekordbox. If rekordbox did get to it, run the export again: it rewrites export.pdb and removes the exportLibrary.db.

### Why does rekordbox 7 say it found a library inconsistency on my stick?

Because the stick carries rekordbox 7's two libraries, the Device Library and OneLibrary, and they no longer list the same playlists, usually because something rewrote one and left the other. If the stick belongs to rekordbox, export again from rekordbox, or format the stick and export from scratch. On a baken stick, run the export again with baken 4.4.0 or later or Bake'n Deck for Mac 1.2.0, which removes the stale OneLibrary files, or delete exportLibrary.db, its -wal and -shm files and exportExt.pdb by hand.

### Are hot cues, memory cues and loops exported?

Yes, from the XML, with hot cues A to H and, since 4.5.0, the colours set in rekordbox. Active loops have no field in the XML, so a memory loop whose comment starts with [active] becomes the track's active loop, and the marker is left out of the comment the player shows. rekordbox's XML does not say which loop is active, so a loop set active in rekordbox needs the marker in its comment as well. Active loops are new in baken 4.4.0 and have not been tried on a player yet.

### Is artwork exported?

By the command line, since baken 4.5.0: --artwork puts the picture embedded in each audio file on the stick, in the sizes rekordbox writes. MP3, AIFF, FLAC and M4A are covered, WAV is not. The Mac app does the same with Add artwork, since 1.3.0.

### Do I need rekordbox installed?

Normally yes, on the same computer or on an attached library drive, because the waveforms and My Settings are copied from rekordbox's own files. Without rekordbox, for example with a Mixxx or Traktor library converted to collection.xml, use --generate-analysis for the waveforms, and either --settings-dir pointing at the My Settings files from any stick rekordbox once exported, or --no-settings. In the Mac app, turn on Generate missing analysis and leave Copy My Settings off.

### Is it free?

The baken command line, expressport included, is free and MIT licensed for macOS, Windows and Linux. Bake'n Deck for Mac, with its USB Export page, is a one-time purchase on the Mac App Store, with no subscription.

## Get USB Export

Bake'n Deck for Mac 1.3.1 is on the Mac App Store: USB Export with its pre-flight and report, next to Headroom, Sort and CDJ Safe. The baken command line, expressport included, is free and MIT licensed: `brew install M-Igashi/tap/baken` on macOS.

[Download on the Mac App Store](https://apps.apple.com/app/baken-deck/id6808813823)

[See all the tools →](https://baken.ravers.workers.dev/)

## Related guides

- [rekordbox Auto Gain: why it does not reach your CDJ](https://baken.ravers.workers.dev/auto-gain): Where the number stops, and what writing the gain into the file changes.
- [Loudness normalization for DJs: a LUFS target or a true peak ceiling?](https://baken.ravers.workers.dev/loudness-normalization): Two ways to even out levels in the file, what each changes, what each leaves to the DJ, and where rekordbox's Auto Gain fits.
- [How to sort a rekordbox playlist by key and BPM](https://baken.ravers.workers.dev/sort): Alphanumeric key, then BPM, written into the playlist so the CDJ plays it in that order.
- [How Headroom measures loudness and true peak](https://baken.ravers.workers.dev/measurement): In-process BS.1770-4 instead of ffmpeg loudnorm: 15x faster per file, 1,036 tracks in 20 s, with the parity numbers.

---

Source: https://baken.ravers.workers.dev/usb-export
