Save and restore MongoDB metadata, use it to set index ordering correctly.