Ndb migration

Finished ndb migration.