Part of the Dkan ecosystem · 14 projects
INTRODUCTION
Clone an existing DKAN dataset including its distributions and references.
Features
- Form at
/node/clone-datasetwith 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:
- Stefan Korn (stefan.korn) - https://www.drupal.org/u/stefankorn
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.
More in the Dkan ecosystem
Most installed first
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.x-dev | Dev | 10–11 | Oct 30, 2026 |