Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Ali_ on December 31, 2009, 01:34:02 AM

Title: Migration from Shared to VPS -- Attachment Issues.
Post by: Ali_ on December 31, 2009, 01:34:02 AM
Hello to anyone who can help out with this little problem.

I just recently moved my smf forum (hosted on bluehost--they're awesome by the way) to a VPS for development reasons. The migration went well, but I've hit a small snag, and was hoping someone could point me the right way, or help solve the issue.

1. I created a sql dump file, smf1.sql, and stored it on the new server.
2. I secure copied all files in the root folder of the smf installation over to the new server.
3. I imported the dump file into the new database on the new server.
4. Made changes accordingly on Settings.php
5. Logged into website at that point, and made changes through the web interface for things such as Themes directory, Smileys, Attachments. etc..

Now the issue seems to occur when I try to actually click on an attachment while browsing the site on the new server, it gives me "404 - Attachment Not Found".  The correct path is used in the admin backend, so I am a little confused as to what I could have possibly missed.  Perhaps a setting in the mysql database that isn't reachable through the web interface?  When checking file maintenance, it says that there are the regular number of files (500 or so) but that it's taking up 0kb.  All files are present in the folder though. 

Also, strangely I can't seem to upload anything and it gives me a fairly generic error: "Your attachment couldn't be saved. This might happen because it took too long to upload or the file is bigger than the server will allow."  My /etc/php5/apache2/php.ini is set to allow uploads up to 500M, so there's another mystery!

I've set permissions to 777 for the correct directories, as far as I know.
Title: Re: Migration from Shared to VPS -- Attachment Issues.
Post by: Arantor on December 31, 2009, 02:17:27 AM
Use repair_settings.php in the first instance. What is repair_settings.php? (http://docs.simplemachines.org/index.php?topic=663.0)

Sounds like the attachment settings aren't right, even though it sounds like they should be. Did you have multiple attachment folders?
Title: Re: Migration from Shared to VPS -- Attachment Issues.
Post by: Ali_ on December 31, 2009, 02:27:53 AM
Yes, I am on the third attachment folder now, I am trying to keep each folder less than 500 attachments.
Title: Re: Migration from Shared to VPS -- Attachment Issues.
Post by: Arantor on December 31, 2009, 02:32:53 AM
Did you reconfigure each folder? (And actually, don't use repair_settings.php in that case!)
Title: Re: Migration from Shared to VPS -- Attachment Issues.
Post by: Ali_ on December 31, 2009, 02:54:54 AM
I am not sure what you mean by reconfigure each folder.  Haven't seen anything close to that other than "maintenance", although I tried it before and what it did was remove all my attachment entries from the database.  The files were still intact in their directories though.
I unfortunately did just try the repair_settings.php, so now I will have to drop the database, and import the .sql file again.  Not that big of a deal, as long as I can get the attachment issue resolved.
Title: Re: Migration from Shared to VPS -- Attachment Issues.
Post by: Arantor on December 31, 2009, 03:00:15 AM
You have three folders, yeah? You need to reset the paths in all 3 folders from the Attachments area, from the screen where you added the additional folders in the first place.
Title: Re: Migration from Shared to VPS -- Attachment Issues.
Post by: Ali_ on December 31, 2009, 04:18:29 AM
I've set the path to those three things to what they're supposed to be.  I just realized my silly mistake. All was well, with the exception of the file ownership.  I did a scp from the old server to the new one using a super-user account, and forgot to switch all ownership to www-data so that apache/php5 could deal with it the way it needs to.  Did a sudo chown -R www-data:www-data * in my public_html directory, and bam!  It all works.

Thank for the assistance Arantor, much appreciated.
Title: Re: Migration from Shared to VPS -- Attachment Issues.
Post by: Arantor on December 31, 2009, 04:19:25 AM
Ah, that was going to be my next question. Good to know it's sorted - if you have no further concerns please consider marking the topic solved :)