Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

DKAN Clone Dataset

No security coverage Under active development

Part of the Dkan ecosystem · 14 projects

INTRODUCTION

Clone an existing DKAN dataset including its distributions and references.

Features

  • Form at /node/clone-dataset with a select field for the dataset, an
    optional title for the clone and an option to copy uploaded files.
  • Preselect a dataset with ?dataset=<dataset identifier>.
  • "Clone" tab on dataset nodes (/node/{node}/clone).
  • "Clone dataset" button on the DKAN datasets list (/admin/dkan/datasets)
    and a menu link under DKAN > Datasets.
  • The clone is validated against the dataset schema before it is saved.
  • The clone is saved as draft (if the DKAN workflow has this state) and the
    edit form of the clone is opened, so it can be adjusted before publishing.
  • Uses Select2 for the dataset field
    if the module is installed.

How it works

The metastore returns the dataset dereferenced, i.e. distributions, publisher,
keywords, themes etc. as full objects. The clone gets this metadata with a new
identifier and the new title (default: "Copy of" and the dataset's title).

The clone is created as a duplicate of the dataset node, so other fields of the
data node (e.g. images or visualizations) are cloned too. The URL alias is not
copied; pathauto creates a new one, if installed.

When the node is saved, DKAN references the metadata as for any other dataset:

  • Shared references like publisher, keywords or themes are reused, both
    datasets point to the same reference nodes.
  • Distributions are matched by their content too: a distribution that is
    identical in both datasets uses the same distribution node. A distribution
    gets its own node as soon as it differs, e.g. by a copied file or when it is
    changed in the clone.
  • With "Copy uploaded files", uploaded files of the distributions are copied
    (next to the original, with a suffix like _0). The clone then has its own
    resources and its own datastore import. File usage is added for the new
    distribution nodes. Without it (and for links to other sites), both datasets
    use the same resource and datastore table.

Shared nodes and resources are safe: when the clone is deleted, DKAN only
removes references and resources that no other dataset uses. The kernel test
CloneDatasetTest checks this: it clones a dataset (with and without copying
files), deletes the clone and verifies that the original dataset, its
references, resources and files are unchanged.

If saving fails, copied files are deleted again.

REQUIREMENTS

  • DKAN (dkan_metastore)

INSTALLATION

Install as you would normally install a Drupal module.
See: https://www.drupal.org/node/895232 for further information.

CONFIGURATION

Grant the permission "Clone dataset" to the roles that should use the form.
Users also need access to the datasets they want to clone.

MAINTAINERS

Current maintainers:

Ask your assistant about DKAN Clone Dataset

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Oct 2026
Latest release
2 hours ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.x-dev Dev 10–11 Oct 30, 2026