WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multisite To Single Install Photos Not Showing? (15 posts)

  1. seahawknationblog
    Member
    Posted 3 years ago #

    Anyone know an easy fix to getting my photos to show when i moved my blog back to single install from a MU site i ran for a few years my images are showing a placholder but image is not showing, i have tried everyhting i can think of, any help would be greatly appreciated?

  2. Jeff Sebring
    Member
    Posted 3 years ago #

    Check the urls for the images against the actual file location. Your multisite installation likely used a different directory for your media library.

    Once you find the discrepency, you can change the entries in the database using a query, or easier, export and use find/replace to replace the old library urls with the new ones. Just make sure you are accurate with what you find/replace, and keep a copy of the unmodified export file.

    If you aren't comfortable with databases, just go through all your posts and pages, replacing the urls individually.

  3. seahawknationblog
    Member
    Posted 3 years ago #

    Jeff, we cannot get them to work, i dont quite understand your explanation, beyond i believe my expertise, we lost it all and are using a dirty hack with redirection plugin pulling photos in from old director, but if you could give a more detailed exaplantion i would greatly appreciate it.

    Also all our articles 3000 of them have no category attached to them or an author, somehow this information was lost in the xml export?

  4. seahawknationblog - Let's do one problem at a time.

    I JUST rolled a multisite to a single install with no issues. So I know it can be done.

    1) Right click on the image and make note of where it's pointing (http://domain.com/files/2011/03/09/foo.jpg for example)

    2) Go into Options -> Media and check where THAT is storing uploads. Normally it's wp-content/uploads

    Now. If they are DIFFERENT you want to CORRECT them :)

    Either change the location to files (using my earlier URL example) or search/replace the database to change http://domain.com/files/ to http://domain.com/wp-content/uploads

    And then you STILL want to toss in a .htaccess rule to redirect /files to /wp-content/uploads for anything you miss.

    FYI, normally you actually edit the export file to fix the URLs before importing.

    Also all our articles 3000 of them have no category attached to them or an author, somehow this information was lost in the xml export?

    That sounds like this problem: http://wordpress.org/support/topic/lost-categories-in-import-of-wordpresscom?replies=16

    If you're really having this much trouble, and it's costing you guys money, go to http://jobs.wordpress.net and post, or look for a consultant to get you sorted.

  5. seahawknationblog
    Member
    Posted 3 years ago #

    Below is a URL of a post image, what we did was create a file in the root called files and stored all the year, month images into it, then we created a 301-permanently moved redirect with

      plugin redirection

    :

    Source URL:/wp-content/blogs.dir/2/files/(.*)
    Target URL:http://seahawknationblog.com/files/$1

    http://seahawknationblog.com/files/2011/01/CST_BK7D3951-nfl_medium_540_360.jpg

    What Hierarchy would i place them into WordPress uploads in if i need to move them, currently i now have them in the root under a folder named files.?

    What is the exact .htaccess redirect rule, i definitely don't have any knowledge in writing apache .htaccess rules!

  6. This post explains how to do the opposite, so just do it backwards.

    http://code.ipstenu.org/2010/moving-your-images-for-multisite/

    This is really easy to fix you know.

    SQL:
    update wp_posts set post_content = replace(post_content, 'wp-content/blogs.dir/2/files/', 'files/');

    .htaccess:

    # Moved Images
    RewriteRule ^wp-content/blogs.dir/2/files/(.*)$ http://domain.com/files/$1 [L,R=301]
  7. seahawknationblog
    Member
    Posted 3 years ago #

    Ipstenu thanks! and with that sql inquiry what folder would you suggest uploads or should i leave em where i have them in the root under a files folder?

  8. seahawknationblog
    Member
    Posted 3 years ago #

    Ok i think i see keeping them where i have them in the root for this command line query

  9. If you've already moved them, I'd leave 'em in /files personally.

    I had NOT moved mine, so I put them back in /wp-content/uploads. It took me about an hour to roll my MultiSite back, and most of that was BuddyPress arguments ;)

  10. seahawknationblog
    Member
    Posted 3 years ago #

    Where exactly do i enter this in my sql?

  11. I do it via phpMyAdmin.

    Go in, go to the database for WP, click on 'SQL', paste that in, hit go.

    And ALWAYS make a backup before you monkey with the Database. ALWAYS! ALWAYS!

  12. seahawknationblog
    Member
    Posted 3 years ago #

    Okay images worked like a charm Ipstenu, wheres the tip jar located?

    Not if i can get all 3000 post back to the correct author and the categories back ill be a happy camper!

  13. seahawknationblog
    Member
    Posted 3 years ago #

    Ipstenu its working great, but i feel it running off the htaccess rewrite?

    My database table have a different prefix than wp_, should i replace the code above with my prefix??

  14. seahawknationblog
    Member
    Posted 3 years ago #

    update SHNB_posts set post_content = replace(post_content, 'wp-content/blogs.dir/2/files/', 'files/');

    Tell me if i am correct on this small change?

  15. My database table have a different prefix than wp_, should i replace the code above with my prefix??

    Yes. Obviously replace wp_posts with whatever your actual table name is :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.