Convert RAW Files in Your Aperture Database to Adobe DNG Files
The following describes how to convert all the RAW images in your Aperture database from manufacturer formats, such as Sony's ARW and Canon's CR2, to Adobe's DNG while retaining all the Adjustments already applied to your RAW files. In the example below I am assuming that your Aperture Library has ARW and CR2 files. These steps work with the latest version of Aperture, being Version 3.3, and have not been tested with earlier versions (in fact, it probably will not work because the database structure changed in 3.3 - however, this means that the steps below can also be applied to your iPhoto library). The steps are:
1. Within Finder select the Aperture Library and Secondary Click to bring up the Shortcut Menu. From this select "Show Package Contents"; this will open a Window showing all the files/directories contained within your Aperture Library.
2. Drag the "Masters" folder out of the Package and place it on your Desktop. The purpose of this step is so that Applications, such as Adobe DNG Converter, can "see" the "Masters" folder, which they cannot do if it is located within the Aperture Library Package.
3. Run the Adobe DNG Converter, select the above "Masters" folder with the "Select Folder" button, make sure you have selected the option "Save in the Same Location", it is also a good idea to select the option "Skip source image if the destination already exists", check your Preferences then select the "Convert" button.
4. Adobe DNG Converter will now convert all the RAW files to Adobe DNG files and save them in the same location as your existing RAW files. Once complete, take a note of (a) the number of files converted and (b) the types of files converted, such as if the conversion includes ARW, CR2, NEF files etc. In this example I will assume that the converter only found ARW and CR2 files; if your system is different then modify the steps below to make sure it covers all the RAW file types converted in your particular system.
5. Select the "Masters" folder and in the Finder Window Search Field search for all the files that end in .ARW and .CR2 (this filename search list should match the types of files found by the Adobe DNG Converter in step (4)(b) above). The number of files returned by the search must match the number of files recorded by the Adobe DNG Converter in step (4)(a) above. Do NOT put the .DNG files in your search criteria. Select all the files found in the search and move them to the Trash. This will delete all the original manufacturer's RAW files from your Aperture Library leaving behind all the new DNG files.
6. Move the "Masters" folder on your Desktop back to the root directory of the Aperture Library Package Content directory.
7. Select the Finder Window containing the Aperture Library Package Contents.
8. If there is a file called "ApertureData.xml" then open it with a text editor. Search and Replace ".arw" with ".dng", ".ARW" with ".DNG", ".cr2" with ".dng" and ".CR2" with ".DNG" (note, do not use the " marks in your search). Make sure you cover all the file types incorporated in your particular system. Save the "ApertureData.xml" file.
9. Traverse to the Database/apdb directory. Select the "BigBlobs.apdb" file and open it with a Hex editor. In this example I will use Hex Fiend by Ridiculous Fish (see http://ridiculousfish.com/hexfiend/). Once the file is open perform a Find and Replace ensuring you are finding and replacing Text and not Hex. In Hex Fiend this means selecting Edit/Find from the menu and then selecting the "Text" button to the top/left of the window. In your Find/Replace field you will need to find ".arw" and replace it with ".dng", make sure you select "Replace All" (note, do not use the " marks in your search). Do exactly the same for ".ARW" with ".DNG", ".cr2" with ".dng" and ".CR2" with ".DNG" (and whatever particular RAW files were in your system).
10. Perform exactly the same steps in (9) for the files "History.apdb", "ImageProxies.apdb", "Library.apdb" and "Properties.apdb".
That is it, your Aperture Library now contains DNG files instead of your original manufacturer files while still retaining all the Adjustments originally made in Aperture to those manufacturer files. Of course, you can repeat the same step and replace your DNG files with the original RAW manufacturer files if you wish. This process works because:
1. Aperture does not store the Adjustments in the RAW files, it keeps these in its internal SQLite database.
2. By using a Hex Editor you (a) don't have to play with SQLite to gain access to Aperture's data and (b) because you are replacing text that has exactly the same number of characters you are not invalidating the format of the underlying data file - this is why you use a Hex Editor instead of a simple text editor.
Think of Aperture as being a repository that holds Adjustments which then link to the original RAW source. Therefore, the above process simply replaces your RAW source and therefore all the Aperture Adjustments are still valid; same Adjustments, new source. In case you ask, no, you cannot transfer Adjustments in and out of Aperture because there is no standard to transform adjustments between different photographic applications.