# Nineteen years of articles moved to a new website.

> A national association in the mobility sector has published news, studies and conference proceedings on its website since 2007. For the new site the archive had to arrive whole: dates, authors, categories, SEO data, images and the documents linked in the text.

- Sector: Associations
- Practice: Websites
- Status: Ongoing
- URL: https://cloudfactory.it/en/projects/wordpress-article-archive-migration/

## In brief

We are building the new website of a national association in the mobility sector, in WordPress with Divi, on one of our AWS servers. We migrated the article archive from 2007 to today with WP-CLI: dates, authors, categories, tags and SEO data. The first import lost many featured images; we redid it from a full export, relinked the images and recovered the 217 documents embedded in the text, mostly PDFs.

- **2,036** articles imported, published, drafts and private
- **867** articles with their featured image relinked
- **217** documents in the text recovered, mostly PDFs
- **776** media library files imported

## Context

The current site holds almost two thousand articles, from 2007 to today, with studies, reports and conference proceedings attached. The new site runs WordPress with Divi and a dedicated child theme, on one of our AWS servers, in an isolated user. We reach it through the AWS console, and files travel the same way.

## The problem

An archive this size cannot be imported from the WordPress dashboard: it times out halfway. And the first import, made from an export of articles only, left more than a thousand published articles without a featured image: that kind of export only includes images uploaded inside each article, not those reused from other articles or uploaded to the library.

## What we did

1. **Command-line import.** We uploaded the export to S3, downloaded it to the server through a temporary link and ran the import with WP-CLI in the background, checking the log at every step instead of waiting for the end.
2. **Redone, not patched.** Running the import again was not enough: existing articles are skipped and images are not relinked. We deleted only the content of the first import, identified by ID, and redid everything from a full export.
3. **Featured images.** We relinked the featured image on all 867 articles that had one on the current site. The oldest articles have none, and stay that way.
4. **Documents in the text.** The articles contained 217 documents, mostly PDFs, which the importer does not bring over because they are not in the library. We copied them to the new site, updated the links and checked that no article still points to files on the old domain.
5. **Categories and tags to rethink.** The sidebar tag cloud has 32 tags, assigned to about fifty articles: the real classification lives in the categories, many with repeated names. We proposed reorganising them on the new site, turning some into tags.

## How it went

The articles are on the new site, in a development environment, with images, documents and SEO data. Pages, calendar events and the members' area are still to migrate.

## Tools

WordPress, Divi, WP-CLI, WordPress Importer, Amazon S3, AWS EC2, Yoast SEO

## FAQ

### Can thousands of WordPress articles be migrated without losing images?

Yes, by exporting all content rather than just articles, and checking after the import how many articles have a featured image compared with the source site.

### Why WP-CLI rather than the WordPress dashboard?

Because from the dashboard an import of thousands of articles that downloads images from the source site almost always times out. WP-CLI has no time limit and can be followed through its log.

### What happens to PDFs embedded in articles?

They have to be recovered separately: the importer only brings the media library. They are downloaded from the old site, uploaded to the new one and replaced in the links.

---

Cloudfactory S.r.l., Rome. Contact: hello@cloudfactory.it
