def copy_file_record(record, node_settings):
    """Copy versions of an `OsfStorageFileRecord`. Versions are copied
    by primary key and will not be duplicated in the database.

    :param OsfStorageFileRecord record: Record to copy
    :param node_settings: Root node settings record
    """
    clone = record.clone()
    clone.versions = record.versions
    clone.node_settings = node_settings
    clone.save()
    return clone