);
Logger.info("...migrating indices...");
Collection indices= db.getMetadata().getIndexManager().getIndexes();
for (Object in:indices){
OIndex i = (OIndex)in;
if (indicesName.contains(i.getName())){
//migrate the index
Logger.info("....." + i.getName());
OIndexCursor cursor = i.cursor();
Set<Entry<Object, OIdentifiable>> entries = cursor.toEntries();
Iterator<Entry<Object, OIdentifiable>> it = entries.iterator();
while (it.hasNext()){
Entry<Object, OIdentifiable> entry = it.next();
String key = (String) entry.getKey();
Object valueOnDb=entry.getValue();
valueOnDb=db.load((ORID)valueOnDb);
if (valueOnDb!=null){
Logger.info("..... key: " + key);
Object value=((ODocument)valueOnDb).field("value");
String indexKey = i.getName().toUpperCase()+":"+key;
ODocument newValue = new ODocument(IndexDao.MODEL_NAME);
newValue.field("key",indexKey);
newValue.field("value",value);
newValue.save();
}//the value is not null
} //while
db.getMetadata().getIndexManager().dropIndex(i.getName());
}//the index is a baasbox index
}//for each index defined on the db
Logger.info("...end indices migration");