Repository navigation
Migrating From MacDive
You can move your MacDive logbook to BlueDive in two ways:
- MacDive's own XML export — export from MacDive (File → Export → XML) and import the file in BlueDive (see Importing Dives From a File). Quick, but limited to what MacDive puts in its XML.
- The conversion script — described on this page. It reads your MacDive library directly and carries over much more.
The free script macdive_to_bluedive.py reads your MacDive database together with a MacDive XML export of the same library, and writes BlueDive files ready to import. It carries over:
- dives with their gear, tanks, profile samples, events and gas switches;
- your critters, as species in BlueDive's catalogue (name, species, category, size, notes and picture), with every sighting linked to its species — including critters tagged on photos;
- the data your dive computer originally downloaded into MacDive, when MacDive kept it: the script decodes it and uses the computer's own profile, dive time, maximum depth, tank pressures, decompression stops and gas switches when they agree with MacDive's values. Since BlueDive 2.2, it also adds the time to surface (TTS) and remaining bottom time (RBT) the computer recorded, which MacDive's XML export doesn't carry, so a migrated dive shows them in the Samples tab and the chart's tooltip like a dive downloaded over Bluetooth;
- gear, gear groups and service history, certifications, or the whole critter catalogue, each as its own file.
Values are copied as stored in MacDive and are never converted. Distance, temperature, pressure and volume units are detected from the XML export's unit setting: Metric (metres, °C, bar, litres), Canadian (feet, °C, psi, cubic feet) or Imperial (feet, °F, psi, cubic feet).
Not carried over: rebreather set-point switches (they are counted in the log), and the seconds of each dive time — dives from the script's file are imported in whole minutes, rounded to the nearest minute. MacDive's own XML export keeps the dive time to the second (see Importing Dives From a File).
- Quit MacDive and work on a copy of its database file, so MacDive and the script never use the same file at the same time. The script only reads the database, but a copy keeps your MacDive library completely untouched.
- Back up BlueDive if it already holds dives (Settings → Data Management → Backup database, see Backing Up Your Data & iCloud Sync).
- Run the script on the Mac where you'll import into BlueDive: dates are written in that Mac's time zone, which is what BlueDive expects.
- A Mac with Python 3.8 or later (no additional packages are needed). If Terminal answers
python3: command not found, install Apple's command-line tools withxcode-select --install; they include Python. - Your MacDive database file: the
.sqlitefile of your MacDive library, usually in~/Library/Application Support/MacDive/. In Finder, choose Go → Go to Folder… and paste that path to find it. - For dives: a MacDive XML export of the same library (in MacDive, File → Export → XML).
- Optional, for decoding your dive computer's original data: the Xcode command-line tools (
xcode-select --install) and an internet connection the first time. The script then downloads and builds the decoding library itself and keeps it in~/Library/Caches/BlueDive/macdive_to_bluedive/; later runs use that copy, even offline. Without the tools, the conversion still works and simply uses MacDive's values.
Download the script from the Scripts folder of the BlueDive repository. The top of the script, and python3 macdive_to_bluedive.py --help, describe every option in detail.
- In MacDive, choose File → Export → XML and save the export (for example
MacDive-Export.xml), then quit MacDive. - Copy the MacDive
.sqlitedatabase file into a working folder (for example a folder namedMacDive Migrationon your Desktop), together with the XML export and the script. If MacDive's Critter Images folder sits next to the database, copy it too, or use--critter-images(see below). - Open Terminal and go to that folder: type
cd(with a space), drag the folder into the Terminal window, and press Return. - Run the conversions you need (see Running it).
- Import the files in BlueDive (see Importing the files).
Run, for example (replace MacDive.sqlite with your database file's name):
python3 macdive_to_bluedive.py MacDive.sqlite dives.xml --export dives --weight-unit kg --macdive-xml MacDive-Export.xml
python3 macdive_to_bluedive.py MacDive.sqlite gear.xml --export gears --weight-unit kg
python3 macdive_to_bluedive.py MacDive.sqlite certs.xml --export certifications
python3 macdive_to_bluedive.py MacDive.sqlite species.bluedive --export species
If MacDive's critter Species field holds group or common names rather than scientific names, add --critter-species omit to the dives and species commands:
python3 macdive_to_bluedive.py MacDive.sqlite dives.xml --export dives --weight-unit kg --macdive-xml MacDive-Export.xml --critter-species omit
| Option | What it does |
|---|---|
--export dives / gears / certifications / species
|
What to convert (default: dives). |
--weight-unit kg or lbs
|
The weight unit you used in MacDive (required for dives and gear). It can't be detected from the database; a weight that names its own unit (e.g. "9 kg") keeps it. |
--macdive-xml PATH |
Your MacDive XML export (required for dives). It must come from the same MacDive library. |
--import-unmatched-tanks |
For rebreather divers (off by default): on CCR/SCR dives whose computer marks its cylinders as oxygen or diluent, matches them to MacDive's tanks by role and gas, gives each tank the computer's pressures, and adds the cylinders MacDive never imported (an oxygen cylinder as 100 % O₂). Added cylinders have no size or working pressure, because the computer doesn't record them. |
--critter-species scientific or omit
|
Whether MacDive's critter Species field holds scientific names (default) or group/common names to leave out. |
--critter-size-unit cm or in
|
The unit of your critters' average size as MacDive shows it (default: cm). |
--critter-images PATH |
MacDive's Critter Images folder, if it isn't next to the database file — for example --critter-images "$HOME/Library/Application Support/MacDive/Critter Images". |
--schema |
Lists the database's tables and columns without converting anything — useful when reporting a problem (python3 macdive_to_bluedive.py MacDive.sqlite --schema). |
-
On screen, the script ends with a summary: how many dives it matched to the XML export, how many dives got TTS and RBT from the computer's original data, the reasons any were not matched (for example
no_matchordepth_mismatch), how many species it wrote, and any critter pictures it could not find. -
For dives, it also writes a log file next to the output (for example
dives.log). It describes each dive's sources — which values came from MacDive's database, the XML export or the dive computer's original data — the units used, and any values the computer's data replaced. - TTS and RBT come only from the computer's original data. A dive without it, or whose original data doesn't agree with MacDive and so keeps MacDive's own profile, has neither. RBT also needs air integration with gas time remaining turned on in the computer (on Shearwater, GTR).
- A dive the script can't match to the XML export is still converted from the database; it only lacks what the XML export provides, such as MacDive's profile samples (the computer's original data can still provide a profile).
- Dives — import the dives file with + → Import on the Dives tab. It already carries every species its sightings use, so keep Import Species on to create them.
- Gear — import it from the Equipment tab (see Equipment & Gear List).
- Certifications — import it from the Documents tab (see Certifications).
- Species — needed only for critters that no dive uses: import it with Marine Life → … → Import Catalogue…, before or after the dives. A species already in your catalogue is never duplicated or changed.
You can re-run the script and import again, for example after correcting something in MacDive. Each dive carries MacDive's own ID, so BlueDive recognizes the dives it already has and shows them as duplicates instead of adding them silently (see Duplicate Detection). Species are never duplicated.
-
python3: command not found— install the command-line tools withxcode-select --install, then try again. -
"No such file or directory" — Terminal isn't in the folder holding the files, or a name is misspelled. Use
cdas in the quick start, or drag each file into the Terminal window to insert its full path. - Many dives not matched — check that the XML export comes from the same MacDive library as the database, and that you exported it after your last changes in MacDive.
-
Critter pictures missing — point
--critter-imagesat MacDive's Critter Images folder. -
Weights look wrong — re-run with the
--weight-unityou actually used in MacDive.