def copy_state_from_container(self, from_version_volume: str, to_version_volume: str, image: str):
        """
        Copy the state from one Docker volume to another using a specified Docker image.

        This function runs a Docker container with the specified image, mounts the source and target volumes,
        and copies the contents from the source volume to the target volume. It is specifically used
        in case when from_version is <2.9 and to_version is >=2.9.

        Args:
            from_version_volume (str): The name of the source Docker volume.
            to_version_volume (str): The name of the target Docker volume.
            image (str): The Docker image to use for the container.

        Raises:
            RuntimeError: If there is an error during the Docker container execution or the copy process.
        """
        # Construct the command to copy files from source volume to target volume
        copy_command = "sh -c 'cd /opt/vespa_old && cp -a . /opt/vespa/var'"

        try:
            # Run a container with the necessary volumes mounted
            container = self.docker_client.containers.run(
                image=image,
                command=copy_command,
                remove=True,  # Automatically remove the container after it exits
                entrypoint="",  # Override the default entrypoint
                volumes={
                    from_version_volume: {'bind': '/opt/vespa_old', 'mode': 'rw'},
                    to_version_volume: {'bind': '/opt/vespa/var', 'mode': 'rw'}
                },
                tty=True,  # Allocate a pseudo-TTY
            )
            self.logger.info(f"Successfully copied state from {from_version_volume} to {to_version_volume}")

        except (APIError, ContainerError) as e:
            self.logger.error(f"Error during state copy from {from_version_volume} to {to_version_volume}: {e}")
            raise RuntimeError(f"Failed to copy state from {from_version_volume} to {to_version_volume}.") from e

        Copy the state from one Docker volume to another using a specified Docker image.

        This function runs a Docker container with the specified image, mounts the source and target volumes,
        and copies the contents from the source volume to the target volume. It is specifically used
        in case when from_version is <2.9 and to_version is >=2.9.

        Args:
            from_version_volume (str): The name of the source Docker volume.
            to_version_volume (str): The name of the target Docker volume.
            image (str): The Docker image to use for the container.

        Raises:
            RuntimeError: If there is an error during the Docker container execution or the copy process.
        
tests/compatibility_tests/docker_manager.py