Move index to temp file