Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

E-Arkiv

Security covered Under active development 3 sites

The E-Arkiv module provides advanced archiving functionalities for Drupal sites, enabling reliable management and storage of archived content. It is designed to help Swedish government websites comply with digital content archiving laws.

E-Arkiv archives a Drupal site as a static copy that can be opened without Drupal, for example to meet the rules for archiving the websites of Swedish public authorities. The archive is a .tar.gz file with the pages and files of the site, a start page, a description of how it was made, checksums and reports of what was missing.

Features

  • Complete crawls with HTTrack. Starts from the site, its sitemap.xml, extra start URLs and, optionally, every published node that anonymous users may view, so that pages no other page links to are archived too. Rabbit Hole settings are respected.
  • Fast. Up to 128 simultaneous connections. A site with about 7,800 URLs and 2.4 GB is archived in about 13 minutes.
  • Alternative host names. Links written as full URLs to the production host, or to the site name without www, point to the archived files when a copy of the site is archived.
  • Exclude patterns for filters, sorting and other pages that only repeat content.
  • Broken links stay usable. Error pages are replaced with a notice in the archive, and the archive lists broken links, published pages that no other page links to, and published pages that return an error.
  • Reports on the site. The broken links, unlinked pages and published pages with errors of the latest archive are shown under Reports › E-Arkiv. They link to the pages and their edit forms, so that editors can fix the content. Users with the View E-Arkiv reports permission can see them without administering archives.
  • Self-describing archives. Every archive has a start page, earkiv-manifest.json with the URL, times, settings and versions used, SHA-256 checksums of every file, and a checksum of the archive file itself.
  • Schedules with iCalendar recurrence rules, for example every Sunday at 02:00.
  • Reliable jobs. Interrupted crawls are resumed, failed jobs can be retried, and progress is shown in the archive list and in Drush.
  • Drush commands to create, process, retry, cancel and follow jobs.
  • Pluggable. Archivers and storage are plugins. The module ships with the HTTrack archiver and storage in the private file system.

What is in an archive

Each archive is a file named like earkiv_12_1794334164.tar.gz. When it is extracted, it contains:

File Contents index.html The start page of the archive: which site was archived and when, a link to the start page of the archived site, and links to the files below. www.example.com/ The archived pages and files, one directory per host, with the links between them pointing to the local files. earkiv-manifest.json A description of the archive: the job, the archived URL, when the crawl started and finished, the versions of E-Arkiv, Drupal and HTTrack, all archiver settings (including the exclude patterns), the numbers of URLs, files, bytes, broken links, unlinked pages and published pages with errors, the path of the start page and the list of reports. earkiv-checksums.sha256 The SHA-256 checksum of every file in the archive, in the format of sha256sum. sha256sum -c earkiv-checksums.sha256 verifies an extracted archive. earkiv-broken-links.csv Links that returned an error when the site was archived: the HTTP status, the URL and the page that links to it. A link that redirects to an error is listed as it is written on the page, with the URL it redirects to. The archive shows a notice in place of each missing page. earkiv-unlinked-pages.csv Published pages that no other page links to, with node ID, language, content type, title, URL and archived file. Only when all published content is included. earkiv-published-errors.csv Published pages that returned an error, with node ID, language, content type, title, URL and HTTP status, for example because of a + in the path alias. Only when there are such pages. hts-log.txt The log of HTTrack. hts-cache/new.txt Every crawled URL with its HTTP status, MIME type, local file and referring page.

The SHA-256 checksum of the .tar.gz file itself is shown in the archive list and stored next to the archive as earkiv_….tar.gz.sha256, which sha256sum -c also reads.

Requirements

  • Drupal 11.2 or later, or Drupal 12.
  • The command line tools httrack, tar and gzip on the server. In DDEV, add webimage_extra_packages: [httrack] to .ddev/config.yaml.
  • A private file system for the archives.
  • Drush, to run the archive jobs.

Getting started

  1. Install the module: composer require 'drupal/earkiv:^1.0@beta' and drush en earkiv.
  2. Configure the URL of the site and the other settings at Configuration › Web services › E-Arkiv (/admin/config/services/earkiv).
  3. Create an archive at Content › E-Arkiv (/admin/content/earkiv), or with drush earkiv:create --process.
  4. Run drush earkiv:process from the server's cron, for example every five minutes, so that jobs and schedules are processed.
  5. See the reports of the latest archive at Reports › E-Arkiv (/admin/reports/earkiv/broken-links).

The README describes every setting, the Drush commands and recommendations for production servers.

Credits

Inspired by the Lullabot article on retiring a Drupal site with HTTrack by Karen Stevenson (KarenS).

Ask your assistant about E-Arkiv

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
3
Tracked since
Mar 2025
Latest release
1 week ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.0-beta2 Pre-release 11 PHP >=8.1 Nov 16, 2026
1.0.0-beta1 Pre-release 11 PHP >=8.1 Nov 11, 2026
1.0.x-dev Dev 11 Mar 18, 2025