Site icon Hip-Hop Website Design and Development

Migrating media files (documents only) to a fresh install and maintaining the same directory structure

I’ve rebuilt an old website from scratch on a fresh install.

On the old (production) website there are over 1000 PDFs and Word docs. These have been uploaded over a 3 year period via /wp-content/uploads/. Files are organised by year and month: /2019/01/filename.pdf, for example.

The new website has a different sitemap. 301 redirects are in place to direct the old posts/pages to the new.

Many of the files which need migrating are attached to posts/pages on the old website. The majority of these posts/pages no longer exist on the new website.

I need to migrate the PDFs and Word docs over to the new website which currently sits on a staging server.

The main objectives are:

  1. Maintain the old file directory structure, e.g. /2019/01/filename.pdf.
  2. Only migrate documents (PDFs, Word docs, txt files etc). Imagery and video is not required.

What’s the best way to achieve this?

I’ve looked into WP Migrate DB Pro, but it looks like this migrates all media files.