News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Attachments from 2.0.19 into 2.1.4

Started by magicalarmchair, Yesterday at 08:55:53 AM

Previous topic - Next topic

magicalarmchair

I received the database before I received the attachment files for my SMF forum. The forum was originally on SMF 2.0.19 and to get the database working right, after getting it restored, I upgraded it to 2.1.4.

The forum itself is now working great, and I have now uploaded the attachments into the attachment folder as below.

 You cannot view this attachment.

And I can see these files in the attachment table.

You cannot view this attachment.

In settings, the directory is correct, however, it says "Files Missing".

You cannot view this attachment.

If I click repair, it says this:

You cannot view this attachment.

But they are clearly there. Is the format different between one version and the other? Is there something I need to do to get these to match up?

Thanks for your help. It really is a cracking forum.


shawnb61

You might want to read this, which explains what is going on & suggests solutions:
https://www.simplemachines.org/community/index.php?topic=591714.0
A question worth asking is born in experience & driven by necessity. - Fripp

magicalarmchair

#2
Thank you, that is very helpful. So summary of next action being to re-uploaded the upgrade.php (that I deleted after upgrade), run it, choose the repair of attachments, and we will be away.

Thank you for writing that post too! I was halfway through writing a bit of php that would have just hacked Dats on the end of the files that would have made things worse I think.

edit: I reuploaded the update.php, and update_helper.php, and I get the below error. What other files does this need please?

You cannot view this attachment.

edit2: I saw you had written some fix code (I should have read on!) I've run smf_attachment_dirs.php and that tells me that

basedirectory_for_attachments, attachment_basedirectories and automanage_attachments are NOT SET.

It shows both my attachment folders are valid files.

On the compare of the db to the file system, it has the error as "Invalid filename", and example row is below.

Given the above, best next step to run your fixer? Will that work do we think?

You cannot view this attachment.


Sir Osis of Liver

Your original mistake was you apparently ran the upgrade without attachments, then uploaded them after upgrade completed.  Having done that, attachments did not have .dat extension, and avatars were not moved from /attachments to /custom_avatar.  Best thing you can do is restore the 2.0.19 install, make sure it's running correctly and attachments and avatars are loading, then run upgrade again on the complete install. 
When in Emor, do as the Snamors.
                              - D. Lister

shawnb61

Quote from: magicalarmchair on Yesterday at 10:30:16 AMedit: I reuploaded the update.php, and update_helper.php, and I get the below error. What other files does this need please?
At this point, I would delete the two upgrade files & try the fixer utility provided instead.

Quote from: magicalarmchair on Yesterday at 10:30:16 AMedit2: I saw you had written some fix code (I should have read on!) I've run smf_attachment_dirs.php and that tells me that

basedirectory_for_attachments, attachment_basedirectories and automanage_attachments are NOT SET.
That is normal if you are not using SMF to manage your attachment directories in an automated fashion.

Quote from: magicalarmchair on Yesterday at 10:30:16 AMIt shows both my attachment folders are valid files.
That's good news!  If you are confident that SMF is now pointing to the proper folder with all the attachment files in it, you can try the fixer utility.

Quote from: magicalarmchair on Yesterday at 10:30:16 AMOn the compare of the db to the file system, it has the error as "Invalid filename", and example row is below.
Given the above, best next step to run your fixer? Will that work do we think?
Wouldn't hurt to try running the fixer.  All those errors are showing you that the upgrader wasn't able to properly process the attachment files.  From the 2.1 perspective, they all have the wrong filename.

If the fixer doesn't work, at that point I'd start to think about restoring & rerunning the upgrade with all the files properly in place.
A question worth asking is born in experience & driven by necessity. - Fripp

magicalarmchair

Thanks both,

I've run the fixer and it ran well. I then went and ran the integrity checking inside SMF, and that corrected some file sizes and now reports "No errors detected" however, files appear to still not come down.

You cannot view this attachment.

hxxp:www.bavariayacht.org/forum/index.php?action=dlattach;topic=2948.0;attach=5149 [nonactive]

You cannot view this attachment.

The final, nuclear option is to blow it away and start again. That isn't so bad, and won't take so long really. Anything I can try before I resort to that?

The other potential is that the files themselves are corrupt and were damaged in transit?

Thanks again for the help, and its been fun learning the your forum, it's a great platform.




shawnb61

The real question is whether your backup is corrupt. 

Some utilities (e.g., FileZilla) corrupted files with no extension, by assuming they were text files & changing all the lfs to crlfs upon download from unix to windows.  But you can't do that to binary files...  (That's why the .dat extensions were added - too many corrupted files...)

Do you have another backup to work from?

You can test the files locally by renaming them.  They start with the attach id.   Find the file that starts with 7981_* & add the proper extension to it.  Then see if you can view the image locally.

A question worth asking is born in experience & driven by necessity. - Fripp

Advertisement: