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
- Create a full backup of your website
- Install and activate the Export Media Library plugin (Free) on the source website
- WordPress Dashboard > Media > Export
- Folder Structure > Nested folders
- Click the Download Zip button
- 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.
- Add your site to FileZilla and connect to it
- In the right pane of FileZilla, browse to the media library (/public/wp-content/uploads/)
- In the left pane of FileZilla, browse to the location of your extracted files
- In the right pane of FileZilla, browse to the media library (/public/wp-content/uploads/)
- 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.)
- 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.
- 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.)
- Install and activate the Media Sync (Free) plugin on the target website
- WordPress Dashboard > Media > Media Sync
- Click the Scan Files button
- Uncheck the Dry Run checkbox
- Select all of the folders that you uploaded
- 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.