docs: public void setProfileFromBackup(JSONObject profileBackup, int profileId, String clientUUID) throws Exception {
          // Reset the profile before applying changes
          ClientService clientService = ClientService.getInstance();
          clientService.reset(profileId, clientUUID);
          clientService.updateActive(profileId, clientUUID, true);
          JSONArray errors = new JSONArray();
  
          // Change to correct server group
          JSONObject activeServerGroup = profileBackup.getJSONObject(Constants.BACKUP_ACTIVE_SERVER_GROUP);
          int activeServerId = getServerIdFromName(activeServerGroup.getString(Constants.NAME), profileId);
          if (activeServerId == -1) {
              errors.put(formErrorJson("Server Error", "Cannot change to '" + activeServerGroup.getString(Constants.NAME) + "' - Check Server Group Exists"));
          } else {
              Client clientToUpdate = ClientService.getInstance().findClient(clientUUID, profileId);
              ServerRedirectService.getInstance().activateServerGroup(activeServerId, clientToUpdate.getId());
          }
  
          JSONArray enabledPaths = profileBackup.getJSONArray(Constants.ENABLED_PATHS);
          PathOverrideService pathOverrideService = PathOverrideService.getInstance();
          OverrideService overrideService = OverrideService.getInstance();
  
          for (int i = 0; i < enabledPaths.length(); i++) {
              JSONObject path = enabledPaths.getJSONObject(i);
              int pathId = pathOverrideService.getPathId(path.getString(Constants.PATH_NAME), profileId);
              // Set path to have request/response enabled as necessary
              try {
                  if (path.getBoolean(Constants.REQUEST_ENABLED)) {
                      pathOverrideService.setRequestEnabled(pathId, true, clientUUID);
                  }
  
                  if (path.getBoolean(Constants.RESPONSE_ENABLED)) {
                      pathOverrideService.setResponseEnabled(pathId, true, clientUUID);
                  }
              } catch (Exception e) {
                  errors.put(formErrorJson("Path Error", "Cannot update path: '" + path.getString(Constants.PATH_NAME) + "' - Check Path Exists"));
                  continue;
              }
  
              JSONArray enabledOverrides = path.getJSONArray(Constants.ENABLED_ENDPOINTS);
  
              /**
               * 2 for loops to ensure overrides are added with correct priority
               * 1st loop is priority currently adding override to
               * 2nd loop is to find the override with matching priority in profile json
               */
              for (int j = 0; j < enabledOverrides.length(); j++) {
                  for (int k = 0; k < enabledOverrides.length(); k++) {
                      JSONObject override = enabledOverrides.getJSONObject(k);
                      if (override.getInt(Constants.PRIORITY) != j) {
                          continue;
                      }
  
                      int overrideId;
                      // Name of method that can be used by error message as necessary later
                      String overrideNameForError = "";
                      // Get the Id of the override
                      try {
                          // If method information is null, then the override is a default override
                          if (override.get(Constants.METHOD_INFORMATION) != JSONObject.NULL) {
                              JSONObject methodInformation = override.getJSONObject(Constants.METHOD_INFORMATION);
                              overrideNameForError = methodInformation.getString(Constants.METHOD_NAME);
                              overrideId = overrideService.getOverrideIdForMethod(methodInformation.getString(Constants.CLASS_NAME),
                                                                                  methodInformation.getString(Constants.METHOD_NAME));
                          } else {
                              overrideNameForError = "Default Override";
                              overrideId = override.getInt(Constants.OVERRIDE_ID);
                          }
  
                          // Enable override and set repeat number and arguments
                          overrideService.enableOverride(overrideId, pathId, clientUUID);
                          int overrideOrdinal = overrideService.getCurrentMethodOrdinal(overrideId, pathId, clientUUID, null);
                          overrideService.updateRepeatNumber(overrideId, pathId, overrideOrdinal, override.getInt(Constants.REPEAT_NUMBER), clientUUID);
                          overrideService.updateArguments(overrideId, pathId, overrideOrdinal, override.getString(Constants.ARGUMENTS), clientUUID);
  
                          // If it has responseCode then update the override with the responseCode. Otherwise, use 200 as response code
                          try {
                              overrideService.updateResponseCode(overrideId, pathId, overrideOrdinal, override.getString(Constants.RESPONSE_CODE), clientUUID);
                          } catch (JSONException e) {
                              overrideService.updateResponseCode(overrideId, pathId, overrideOrdinal, "200", clientUUID);
                          }
                      } catch (Exception e) {
                          errors.put(formErrorJson("Override Error", "Cannot add/update override: '" + overrideNameForError + "' - Check Override Exists"));
                          continue;
                      }
                  }
              }
          }
  
          // Throw exception if any errors occured
          if (errors.length() > 0) {
              throw new Exception(errors.toString());
          }
      }