Save and restore resources.