code: def migrate_data(ignore: Sequence[str],
                   new_data_path: str,
                   old_data_path: str):
      
      # the new ’data’ path is actually /var and /data is in /var/data
      dest_data = os.path.join(new_data_path, 'data')
      LOG.info(f"migrate_data: copying {old_data_path} to {dest_data}")
      os.makedirs(dest_data, exist_ok=True)
      with os.scandir(old_data_path) as scanner:
          for entry in scanner:
              if entry.name in ignore:
                  LOG.info(f"migrate_data: ignoring {entry.name}")
                  continue
              src = os.path.join(old_data_path, entry.name)
              dest = os.path.join(dest_data, entry.name)
              if os.path.exists(dest):
                  LOG.info(f"migrate_data: removing dest tree {dest}")
                  shutil.rmtree(dest, ignore_errors=True)
              if entry.is_dir():
                  LOG.info(f"migrate_data: copying tree {src}->{dest}")
                  shutil.copytree(src, dest, symlinks=True,
                                  ignore=migrate_files_to_ignore)
              else:
                  LOG.info(f"migrate_data: copying file {src}->{dest}")
                  shutil.copy2(src, dest)
docs: Copy everything in the app data to the root of the main data part
  
      :param ignore: A list of files that should be ignored in the root of /data
      :param new_data_path: Where the new data partition is mounted
      :param old_data_path: Where the old date files are