Problems upgrading from SMF 1.0.19 to 2.2

Started by mikes84, March 11, 2012, 10:10:41 PM

Previous topic - Next topic

mikes84

Hi, I'm trying to upgrade my working SMF forum version 1.0.19 to version 2.2.

I downloaded the large upgrade for 2.2 and extracted it to the root of the current forum, then successfully ran upgrade.php.
It seemed like everything went seamlessly. However, I noticed that a broken image icon appears instead of the photos for posts that have attachments. In addition, if I click the filename, I get a page that reads "404 - Attachment not found" I wasn't sure if there was a problem with the .htaccess file in the /attachments directory, so I ruled that out by temporarily renaming it. Still received the error.

The next thing I thought to try was the attachment file maintenance feature. This process ran to completion and said it was successful, but now posts that I know had valid picture attachments no longer show any type of attachment at the bottom. In addition, I checked the database side of things in the attachments table and I can't help but think there's a problem with the linkage between the file_hash/filename and the physical file. Also, I'm not sure if the function getLegacyAttachmentFilename has anything to do with it since it's an older version of the software. I can't find any relationship betwen the file_hash and the physical file name.

I know that's a lot to process, but what could I be doing wrong? Thanks in advance.

Mike

Aleksi "Lex" Kilpinen

It sounds like you may have stumbled across a bug. It is possible, since you were upgrading from such an old version - that there might be something the upgrade didn't account for. Did you check if the images were intact and working outside SMF, before running the maintanance routines?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

mikes84

Yes, the images are still intact. If I rename the physical file in my attachments directory "37624_Arnie_jpg42d477bad5b3178aceaf29c7bc43daaa" to "Arnie.jpg" (or anything, as long as I add the .jpg extension) it will open in a photo editor just fine.

Is there an easy way to tell what the physical file name for each attachment should be, only using the data stored in the attachments table? I know I could look at the filename field and search for the physical file that has the name embedded in it (e.g.  37624_Arnie_jpg42d477bad...), but there are multiple attachments that have the same original file names, so I'm not sure exactly which physical files they would map to in the attachments directory.

The reason I ask is because I think old attachments will work in 2.02 if the original file name (stored in the filename field) matches the physical file name (instead of the long one I mentioned above) and if the id_hash field is empty. So, if I were able to tell from just the attachments table what the physical file names currently are, I can write a batch script to rename them back to their original file names and get out of the business of these long file names without extensions.

Does that make sense?

Aleksi "Lex" Kilpinen

Do you still have backups from before the upgrade? Just making sure, before asking you to try anything foolish. :P

First thing I would try, would be running the upgrade again - Just uploading the upgrade.php and *.sql files from the large upgrade package should be enough, and then run the upgrade.php.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

sootersong

It sounds like you may have stumbled across a bug.

mikes84

OK, good news and bad news.

The good news...

I found out what the problem was. My ftp client limited the number of files it would list in a directory to 10,000. With 63,000 attachments, I can see how many of them would not be found -- they just weren't there. I went on to the original server, tar.gz'd the entire directory, moved it to the target server, and unzipped it, which worked! So by that point, I had a clone of the current site on the target server and was good with everything on SMF 1.0.19.

The bad news.....

After running the large upgrade for 2.0.2, none of the photo attachments appear in the posts anymore, yet the links to the attachments at the bottom of the posts DO WORK, so I know the forum is seeing them. I'm just not sure why they're not appearing in line as they did before the upgrade. Any ideas?

As a side note, the upgrade did hang at times and I had to remove some lines from upgrade_1-1.sql to get it to keep going. I removed the lines involving creating a search index and attachment thumbnails. I know you're probably reading this and thinking that removing the lines regarding the attachment thumbnails is what did it, but the photos were working just fine before, so I'm not sure why that would matter very much. And if it does, how could I get around the hanging issue which caused me to remove those lines in the first place?

Thanks for everyone's help thus far!

Mike

NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

dfwer

so I'm not sure exactly which physical files they would map to in the attachments directory.

kat

Quote from: mikes84 on March 12, 2012, 07:56:54 AMso I'm not sure exactly which physical files they would map to in the attachments directory.

* K@ detects another parrot...

Advertisement: