WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Images not showing up after migrating from individual blogs (23 posts)

  1. Michael Gorman
    Member
    Posted 2 years ago #

    Greetings!

    I'm in the process of migrating my university away from a poorly managed jumble of individual, outdated WordPress installs (http://blogs.iwu.edu/) to a single install of WordPress multisite 3.2.1 (currently at http://blog-test.iwu.edu/, though we're planning to move it to the old domain once everything is up and running) using subdirectories, not subdomains. We're running on Ubuntu 10.04 and PHP 5.3.2-1ubuntu4.9 on a dedicated VM in our own data center.

    I started working on this a few months ago using an intra-only dev server. I migrated all of the content from the current site to the dev server at that time. Yesterday, when the new, public-facing, test server was set up, I migrated that content (which is now a couple of months out of date) from the dev server. All of that content seems to be showing up just fine.

    The problem is, I'm now trying to migrate recent posts from the old site to the test site, and images aren't showing up. They exist on the server, but I can't find a way to view them online. For instance:
    old post: http://blogs.iwu.edu/admissions/?p=25
    old image: http://blogs.iwu.edu/admissions/wp-content/uploads/2011/10/goldilocks.jpg
    new post: http://blog-test.iwu.edu/admissions/2011/10/04/the-goldilocks-principle-of-applying-to-colleges/
    new image: http://blog-test.iwu.edu/admissions/files/2011/10/goldilocks.jpg
    The file /var/www/wp-content/blogs.dir/45/files/2011/10/golidlocks.jpg does exist.

    Any thoughts on how I might get these images to show up?

  2. Did you setup your .htaccess correctly?

  3. Michael Gorman
    Member
    Posted 2 years ago #

    I believe so; it's a direct copy-and-paste from the Network Setup instructions.

  4. Michael Gorman
    Member
    Posted 2 years ago #

    Oh, darn. Thought it had public DNS. I'll check when I get back from lunch.

  5. Michael Gorman
    Member
    Posted 2 years ago #

    Nope. I get a 200 with a content-type of image/jpeg and a content-length of 11506, but nothing shows up. (The content-length in the old site's response is 33723.)

  6. Michael Gorman
    Member
    Posted 2 years ago #

    Any other ideas, anyone?

  7. Sorry, I was sick yesterday.

    I would think something's not set up correctly in the new account. The .htaccess not redirecting usually means mod_rewrite isn't set up with enough allow overrides going on to let it double jump. Which is probably still the case with ms-files. Make sure that your httpd.conf file lets both the old domain and the new one use allowoverride set to ALL.

  8. Michael Gorman
    Member
    Posted 2 years ago #

    /etc/apache2/httpd.conf is empty and /etc/apache2/apache2.conf doesn't have any AllowOverrides. The only relevant AllowOverrides I can find (which I believe are set correctly) are in /etc/apache2/sites-available/default:

    <VirtualHost *:80>
    	ServerAdmin webmaster@localhost
    
    	DocumentRoot /var/www
    	<Directory />
    		Options FollowSymLinks
    		AllowOverride None
    	</Directory>
    	<Directory /var/www/>
    Options FollowSymLinks Indexes MultiViews
    AllowOverride All
    		Order allow,deny
    		allow from all
    	</Directory>
    
    	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    	<Directory "/usr/lib/cgi-bin">
    		AllowOverride None
    		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    		Order allow,deny
    		Allow from all
    	</Directory>
    
    	ErrorLog /var/log/apache2/error.log
    
    	# Possible values include: debug, info, notice, warn, error, crit,
    	# alert, emerg.
    	LogLevel warn
    
    	CustomLog /var/log/apache2/access.log combined
    
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
    
    </VirtualHost>

    I tried manually replacing an image that hadn't been showing up, and it worked. Do you think it might be faster to do that than to keep trying to figure out why the automatic migration isn't working for images?

  9. See "AllowOverride None"?

    That's possibly it. It should be "AllowOverride All"

  10. Michael Gorman
    Member
    Posted 2 years ago #

    I changed that and restarted apache, but it didn't fix the problem. "AllowOverride None" is only under directories that aren't used by WordPress, anyway (the server root, /usr/lib/cgi-bin, and /usr/share/doc/); the one that is relevant (/var/www/) has been "AllowOverride All" this whole time.

  11. In your post I saw this:

    DocumentRoot /var/www
    	<Directory />
    		Options FollowSymLinks
    		AllowOverride None
    	</Directory>
    	<Directory /var/www/>

    Which is why I pointed it out.

  12. Michael Gorman
    Member
    Posted 2 years ago #

    Yeah; I saw that, too, but changing that to AllowOverride All didn't fix the problem.

    It seems like the faster way to go will be manually re-uploading the images. It'd be nice to have an algorithmic solution in case others in the future have a similar problem, but for me, today, that doesn't seem very realistic since I need to get the whole thing up and running ASAP.

    Thanks so much for your help, Ipstenu; even though we haven't optimally solved the problem, it's great that there are people like you who help people like me without really asking anything in return.

  13. If you import/export it should have brought the images over (and re-uploading makes ... no sense as a fix o.O)

  14. Michael Gorman
    Member
    Posted 2 years ago #

    Yeah, import/export did bring the images over, but only to the filesystem; they wouldn't show up online. I've already finished re-uploading all of the recent images, and they are showing up now. I'm not sure why it works, just that it does work.

    I will certainly agree, though, this whole issue seems to make very little sense at all.

  15. See that's what doesn't make sense.

    If the images were copied over to the filesystem, then ... they're there. You know? The filesystem is /www/blog-new/wp-content/blogs.dir/1/files/etc right?

    Are you having to reimport the images to the media admin page or just FTP them back up?

  16. Michael Gorman
    Member
    Posted 2 years ago #

    I went in through the admin interface and edited each individual post, re-uploading the images through my web browser. When I SSH to the server and cd to the storage location, I now see two files:

    /var/www/wp-content/blogs.dir/45/files/2011/10/goldilocks.jpg
    /var/www/wp-content/blogs.dir/45/files/2011/10/goldilocks1.jpg

    Both are owned by www-data:www-data and both have 644 permissions. But when I open my web browser and go to
    http://blog-test.iwu.edu/admissions/files/2011/10/goldilocks.jpg
    I see nothing; when I go to
    http://blog-test.iwu.edu/admissions/files/2011/10/goldilocks1.jpg
    I see an image.

  17. Wow. Okay. THAT is a sign of a server error. What do your error logs say?

  18. Michael Gorman
    Member
    Posted 2 years ago #

    /var/log/apache2/error.log isn't showing anything when I load either image.
    /var/log/apache2/access.log shows:

    10.2.56.84 - - [07/Oct/2011:13:29:47 -0500] "GET /admissions/files/2011/10/goldilocks.jpg HTTP/1.1" 200 11863 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1"
    10.2.56.84 - - [07/Oct/2011:13:29:50 -0500] "GET /admissions/files/2011/10/goldilocks1.jpg HTTP/1.1" 200 34080 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1"
  19. What happens if you deleted goldilocks.jpg and manually re-uploaded her via FTP only?

  20. Michael Gorman
    Member
    Posted 2 years ago #

    Now it works. What the...?

  21. Hah, okay when the files were copied up something was wrong. Betcha if you re-upload them manually it'll magically fix them all.

    That's a wild server glitch, though!

  22. Michael Gorman
    Member
    Posted 2 years ago #

    Okay, so if I understand this correctly, it seems like PHP hit a memory limit when it was processing the XML file and downloading the images off of the original server. Which makes sense, since the file size was shorter and now the two are identical. The reason I wasn't seeing anything would be because the server was returning truncated (and, thereby, invalid) JPGs.

    Thanks, again, Ipstenu, for all of your help in diagnosing the problem.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.