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
How it works
Current site
Articlessince 2007
Media libraryimages
Documents in textmostly PDF
Transfer
Full exportS3, temporary link
File recoveryscript
New site
WP-CLI import, checked at every step
Isolated userDivi and child themeDates and authorsSEO dataFeatured imagesUpdated links
Result
Articles2,036
Images relinked867 articles
Documents217 files
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. 01

    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. 02

    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. 03

    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. 04

    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. 05

    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

WordPressDiviWP-CLIWordPress ImporterAmazon S3AWS EC2Yoast 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.

Contact

Facing something similar?

Tell us what you run today and what isn't working. We'll reply within one business day with a first technical read.

Email
hello@cloudfactory.it
Address
Viale di Trastevere 114, 00153 Rome, Italy