I downloaded all files from wp-content/uploads and copied to new Wordpres instance on localhost (Windows IIS Express also on MacOS with MAMP). Unfortunately in both cases I don’t see my files in Media Library.
Isn’t just needed to copy and paste files to wp-content/uploads to get access to them fom new, completely clean instance of WordPress?
Strange is the fact that all newly uploaded files via Media Library are saved to the same location where I put my copied files.

For example, I have a folder wp-content/uploads/2016/04 and there are images transfered from online server via FTP. No one of them is visible via Media Library. When I upload a new file for example new123.jpg it’s visible in media library and also ../uploads/2016/04/. But other files still aren’t visible from wordpress.

I set privilages for all files and folders to chmod 777 equivalent.
I had tried everything. I know how to copy database, change urls etc. All post and pages works.
Until today I just know that there is one way to download all images during import WordPress, it’s needed to check “download attachments”.
But that’s not solution, I’m sure that there should be the way to get access to files from /uploads/ just copied directly from another location.

I’ll be very glad for any tips and help.

1 Answer
1

There are three ways you could do this:

1. Upload all into the Media Library

The most tiresome way, IMHO, is to upload all the images you got via the media library.

2. Use a plugin

You can use plugins like Add From Server to import your images easily to the Media Library

3. WP-CLI

Easiest way once you got WP-CLI installed. Run wp media import to import all images easily.
Quoting an example:

# Import all jpgs in the current user's "Pictures" directory, not attached to any post
wp media import ~/Pictures/**\/*.jpg

Leave a Reply

Your email address will not be published. Required fields are marked *