Add pre/post archive/restore (closes #1638)