0

I read it was more secure to use something else besides wp_ as the database prefix, so I downloaded my .sql file replaced all instances of wp_ with tsi_ and then dropped the wp_ tables and imported my .sql file.

The prefix is now correct, so then I went to my wp_config file and changed the prefix table from wp_ to tsi_ and I thought everything was good.

Well, all my posts were still there, but the images are missing. I say missing because when you look in the uploads folder they are there, correctly sorted and everything, but in the media library, they appear as grey icons instead of the previews and they are missing from all my posts. Is there any way to get the images to display correctly?

*The domain name did not change or any of my settings, I just changed the database prefix and that's it.

The grey icons in the media library:

enter image description here

The posts without images:

enter image description here

Thanks,
Josh

  • The database prefix is not a security factor. There is just no point changing it. Anyone who could make use of it is already too deep in your system. Don’t waste your time with security theater. – fuxia Aug 13 '14 at 8:26
0

Ok...

So after some more research I found: http://andrewapeterson.com/2012/08/fix-wordpress-media-library-and-attachments-broken-after-movingcloning-site/ which explains that you can't just do a find and replace in a text editor and be good to go.

Fortunately, I still had the original database, so I dropped all the tables in the tsi_ database and restored the original wp_ database.

All my images were restored and the site was back to normal, now to change the database prefix properly...

I found a plugin called Change DB Prefix: https://wordpress.org/plugins/db-prefix-change/ it allows you to put in the old prefix wp_ and replace it with a new one tsi_.

The plugin safely changed my database prefix and updated my wp_config file in less than a second! All my images are fine and everything is now up and running correctly with the new database prefix!!

Hope this helps someone!

Thanks,
Josh

0

This is not related to DB prefix, this is an option for uploads folder commonly this folder is mydomain.com/wp-content/uploads, but sometimes WP confuses this directory, you can solve changing this to empty, so WP will browse the files in the proper directory.

This option can be changed on settings - Media or using phpmyAdmin looking for the option uploads folder.

:)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.