Two-step frequency conversion for connecting distant quantum memories by transmission through an optical fiber