private int doMigration() {

            //move Offline Log Images from legacy directory to GeocacheData directories
            if (currentVersion < 1) {
                setMigratedVersion(1, "OfflineLogImages");

                //legacy cgeo offline log images dir
                final File legacyOfflineLogImagesDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), CGEO_DIRNAME);

                //migrate existing Offline Log Image paths
                if (legacyOfflineLogImagesDir.isDirectory()) {
                    final File[] files = legacyOfflineLogImagesDir.listFiles();
                    if (files != null) {
                        for (File offlineImage : files) {
                            if (offlineImage.isFile()) {
                                displayProgress(offlineImage.getName());
                                FileUtils.copy(offlineImage, ImageUtils.getFileForOfflineLogImage(offlineImage.getName()));
                            }
                        }
                    }
                }
            }

            //delete theme files from outdated internal theme file dir
            if (currentVersion < 2) {
                setMigratedVersion(2, "InternalThemeDirMigration");
                FileUtils.deleteDirectory(new File(getGeocacheDataDirectory("shared"), MAP_THEME_INTERNAL_DIR_NAME));
            }

            //delete theme files from outdated internal theme file dir
            if (currentVersion < 3) {
                setMigratedVersion(3, "Move Mapsforge SVG Cache Dir");
                //emergency fix for #12340: SKIP actual migration
                //FileUtils.deleteFilesWithPrefix(getInternalCgeoDirectory(), "svg-");
                //FileUtils.deleteFilesWithPrefix(new File(getInternalCgeoDirectory(), "files"), "svg-");
            }

            return finalVersion;
        }
Returns the external public cgeo directory, something like <pre>/sdcard/cgeo</pre>.
It falls back to the internal cgeo directory if the external is not available.
main/src/main/java/cgeo/geocaching/storage/LocalStorage.java