def METHOD_NAME(
    db_user: str,
    db_password: str,
    db_port: str,
    db_name_source: str,
    db_name_target: str,
    db_container_name: str
) -> Union[Exception, None]:
    """Connect to the DB, drop the target DB if it exists, recreate it, dump the
    contents of the source DB, and import them to the target DB.
    Parameters
    ----------
    db_user : str
        The user that has access to the DB.
    db_password : str
        The password of the user that will be used to connect to the DB.
    db_port : str
        The port that the DB is running on.
    db_name_source : str
        The name of the database you want to copy from.
    db_name_target : str
        The name of the database you want to copy to.
    db_container_name : str
        The name of the container that runs the database.
    Returns
    -------
        output: Exception | None
    """
    try:
        log(logging.debug, "Getting DB container's IP...")
        client = docker.from_env()
        db_container = client.containers.get(db_container_name)
        IP = db_container.attrs["NetworkSettings"]["Networks"][
            "deployment_default"]["IPAddress"]
        log(logging.debug, "Done.")
        log(logging.debug, "Connecting to the DB...")
        ps_connection = psycopg2.connect(
            user=db_user, password=db_password, host=IP, port=db_port)
        ps_connection.autocommit = True
        cursor = ps_connection.cursor()
        log(logging.debug, "Done.")
        log(logging.debug, "Dropping the old target DB if it exists...")
        cursor.execute(
            f"DROP DATABASE IF EXISTS {db_name_target} WITH ( FORCE );")
        log(logging.debug, "Done.")
        log(logging.debug, "Recreating the target DB...")
        cursor.execute(f"CREATE DATABASE {db_name_target} OWNER {db_user};")
        log(logging.debug, "Done.")
        log(logging.debug, "Dumping the contents of the source DB...")
        db_container.exec_run(
            f"/bin/bash -c 'pg_dump -U {db_user} {db_name_source} > dump.sql'")
        log(logging.debug, "Done.")
        log(logging.debug, "Importing the contents to the target DB...")
        db_container.exec_run(
            f"/bin/bash -c 'psql -U {db_user} {db_name_target} < dump.sql'")
        log(logging.debug, "Done.")
        log(logging.info, "Success.")
        output = None
    except (Exception, psycopg2.DatabaseError) as err:
        log(logging.error, err)
        output = err
    finally:
        if ps_connection:
            cursor.close()
            ps_connection.close()
        if client:
            client.close()
        log(logging.debug, "Connections have been closed. Goodbye.")
    return output