(bug 62210) Use EntityStore for maintenance scripts

Change-Id: I82dbb8d7254c0a604a20376c7618ab3b022c0093
Merge "(bug 62210) Use EntityStore for maintenance scripts"