Migrating to new directory


I setup my realm configuration in the Cache directory and would like to migrate it to the data directory. Any ideas how to do that? If I remove the “.directory” line it will point to the data directory but my realm data is lost.

RealmConfiguration realmConfiguration = new RealmConfiguration.Builder()
.name(BuildConfig.APPLICATION_ID + “.realm”)
.migration(new POSMigration())