Fix NPE, formatting
Add migrate method from AdminCmd plugin