Migrate the WordPress Media Library Between WordPress Websites

Things to keep in mind:

    • Every environment (infrastructure, software, etc.) is unique, so there’s no universal approach to configuring a solution.
    • Review and understand all available settings, configuring them to the best of your ability, while not blindly guessing.
    • If a specific setting isn’t mentioned, the defaults are acceptable, or the settings are self-explanatory to any skill level.

One of my clients wanted to completely rebuild their WordPress website, and bringing over almost 5,000 images was one of the required tasks. However, the import/export functionality built into WordPress is ineffective for this type of job, especially when you think each image needs to be “registered” with its corresponding post, which was also being brought over separately.

This guide will show you how to copy or move your images between sites easily.

Implementation

Source Website

  1. Create a full backup of your website
  2. Install and activate the Export Media Library plugin (Free) on the source website
  3. WordPress Dashboard > Media > Export
  4. Folder Structure > Nested folders
  5. Click the Download Zip button
  6. After downloading the zip file, proceed to extract its contents onto your local workstation

Upload Media Using FileZilla

Using an FTP application like FileZilla (Free) or a WordPress plugin like File Manager (Free), you want to upload each folder from your extracted files, one by one, choosing to overwrite the destination when/if prompted.

  1. Add your site to FileZilla and connect to it
  2. In the right pane of FileZilla, browse to the media library (/public/wp-content/uploads/)
  3. In the left pane of FileZilla, browse to the location of your extracted files
  4. In the right pane of FileZilla, browse to the media library (/public/wp-content/uploads/)
  5. Drag the folder for each year from the left pane to the right pane, as shown in the image below (Note: Choose to overwrite the files when/if prompted.)
  6. Repeat the above steps until each folder year has been copied over

Target Website

This is the server we are migrating your images to. Once your images are copied to the server, we need to sync them with your database, pulling them into your WordPress Media Library and thus making them available to your website.

  1. Create a full backup of your website. (Note: Before starting any work on your website, it’s good to create backups so you can always undo your work if needed.)
  2. Install and activate the Media Sync (Free) plugin on the target website
  3. WordPress Dashboard > Media > Media Sync
  4. Click the Scan Files button
  5. Uncheck the Dry Run checkbox
  6. Select all of the folders that you uploaded
  7. Click the Import Selected button

After the sync completes, your Media Library will be available on your website, and any posts that migrate over will have their images attached.

Share Post

Our newsletter dares to be different.

Your trust matters. That trust is awarded by providing you with quality content and never sharing your information.