Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: GunDude on July 11, 2019, 09:57:09 AM

Title: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 11, 2019, 09:57:09 AM

Just moved to a new host, but all attachments and uploaded avatars disappeared.... I've read tons of threads about ASCII file types and such when FTP'ing, but I downloaded the attachments folder from cPanel NOT FileZilla or anything like that. 

Is there a way to get those files to re-associate with posts and avatars to users? 

I've spent two hours searching and can't find a solution.

Thanks in advance!
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Illori on July 11, 2019, 10:04:25 AM
did you fix your file paths using repair_settings.php?
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 11, 2019, 10:08:04 AM
Yes, all path's are correct.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Illori on July 11, 2019, 10:12:24 AM
how did you move the forum to the new server? please explain step by step.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GigaWatt on July 11, 2019, 10:21:26 AM
How are user's avatars and attached files viewed in a browser? Do attached files appear as attachments (paperclips) within a post when viewing that post? What happens if you click on the paperclip (attachment)?
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 11, 2019, 04:25:46 PM
Quote from: Illori on July 11, 2019, 10:12:24 AM
how did you move the forum to the new server? please explain step by step.
Well, I was one of two people working on the move... since the forum was hosted in an account I had for years, running SMF for this group.  The new hosting account is owned by the group now and he's the admin.

From cPanel, I performed backups in both phpMyAdmin and Backup Wizard.

In mpPHPadmin: by selecting the proper structure on the left, then going to Export, leaving method on Quick, dropdown on SQL, and clicking GO.
then in Backup Wizard: Did a backup (partial) of MySQL Databases and selected the right database.

Both of these files were put in Dropbox and shared with him.

Unfortunately, on the restore side -- I don't know (yet) what my colleague did to restore the forum. I'll have to find that out.

Everything looked great til I noticed the attachments were just not showing at all in posts, and no avatars were there. 

This is when I went in again thru cPanel File Manager and found the appropriate attachments folder (verified in the old forum) as being correct, and compressed and downloaded all the files.  Those were sent to my colleague who uploaded them to the attachments folder, verified the path was correct in repair_settings.php

Still, no attachments show.  Running a validation/repair on the new forum showed no errors... I was hoping this would re-attribute those files to users and posts.

Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 11, 2019, 04:27:07 PM
Quote from: GigaWatt on July 11, 2019, 10:21:26 AM
How are user's avatars and attached files viewed in a browser? Do attached files appear as attachments (paperclips) within a post when viewing that post? What happens if you click on the paperclip (attachment)?

Normally they show up as thumbnails in the post with a paperclip.  They are just non-existent on the newly moved forum.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Kindred on July 11, 2019, 04:39:08 PM
you backed up the database and installed it on the new server...   did you *ALSO* back up the **FILES** and move them to the new server?

(php and other files, not database files)
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Sir Osis of Liver on July 11, 2019, 04:41:20 PM
If you can pm cpanel access (url/user/pw) I'll have a look.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 11, 2019, 04:50:16 PM
Quote from: Kindred on July 11, 2019, 04:39:08 PM
you backed up the database and installed it on the new server...   did you *ALSO* back up the **FILES** and move them to the new server?

(php and other files, not database files)

No, there was a fresh install of the SMF forum on the new server where the database was restored to.  Mods were then done on the new (there were only a handful).
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 11, 2019, 04:53:52 PM
Quote from: Sir Osis of Liver on July 11, 2019, 04:41:20 PM
If you can pm cpanel access (url/user/pw) I'll have a look.
I have yet to get cPanel access on the new server.  The other person is the admin and so far the details he's sent me hasn't worked.  I guess he's been unsuccessful in adding me as a cPanel user.  Once I get access, I'll set up a screen share or something with you... thanks for offering.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Sir Osis of Liver on July 11, 2019, 05:03:06 PM
Was the forum at 2.0.15 before the move, or has it been upgraded since?
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 11, 2019, 05:04:23 PM
It was (and is) 2.0.15.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Kindred on July 11, 2019, 05:06:34 PM
Quote from: GunDude on July 11, 2019, 04:50:16 PM
Quote from: Kindred on July 11, 2019, 04:39:08 PM
you backed up the database and installed it on the new server...   did you *ALSO* back up the **FILES** and move them to the new server?

(php and other files, not database files)

No, there was a fresh install of the SMF forum on the new server where the database was restored to.  Mods were then done on the new (there were only a handful).


Everyone else can stop trying to help...    He has just told us the EXACT problem.

If you did not back up and restore the actual FILES, then you did not transfer the attachments or avatars. period.

The only way to get them is to go back and get the *FILES* from your original server
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 11, 2019, 05:10:53 PM
QuoteEverything looked great til I noticed the attachments were just not showing at all in posts, and no avatars were there. 

This is when I went in again thru cPanel File Manager and found the appropriate attachments folder (verified in the old forum) as being correct, and compressed and downloaded all the files.  Those were sent to my colleague who uploaded them to the attachments folder, verified the path was correct in repair_settings.php

Still, no attachments show.  Running a validation/repair on the new forum showed no errors... I was hoping this would re-attribute those files to users and posts.

Originally yes, when the database was restored.. the attachments weren't there.  But, I saw the error of my ways and went and got them as described and he uploaded them to the attachments folder.

How can you get them to re-attribute them to posts if the files are there but the forum doesn't see them?
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Kindred on July 11, 2019, 05:13:57 PM
did you run some sort of correction (like correct forum errors) when the files were missing?   If so, then the ONLY way to recover them to the threads and avatars is to restore the old database on the new server again.

Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 11, 2019, 05:53:23 PM
Quote from: Kindred on July 11, 2019, 05:13:57 PM
did you run some sort of correction (like correct forum errors) when the files were missing?   If so, then the ONLY way to recover them to the threads and avatars is to restore the old database on the new server again.
I think I did, prior to realizing these files were not there.

Anything else to know or just do a restore like previously and if the attachments are there we should be good?
Are there any other files that would need to be moved manually with what I described?

Thanks for your help. Sounds like you got to the bottom of it.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Sir Osis of Liver on July 11, 2019, 06:05:49 PM
If you have a good db backup from original forum, and all files are present on new server, import the backup, run repair_settings, and it should be good.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Illori on July 11, 2019, 07:48:58 PM
you would loose any posts/topics/members if any were made on the new location if you do that but it is the only way to get the attachments back.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Bigguy on July 11, 2019, 07:56:47 PM
Is there not file maintenance under Attachments and avatars in the admin panel. Has that been run yet. ??
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: Kindred on July 11, 2019, 08:34:29 PM
That's the problem... he ran it when the files were missing -- the system detected that the files were missing and removed all attachments and avatars.

The ONLY way to restore the information is to restore the database with the correct information still in it.

Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 12, 2019, 08:01:06 AM
Quote from: Bigguy on July 11, 2019, 07:56:47 PM
Is there not file maintenance under Attachments and avatars in the admin panel. Has that been run yet. ??

There is, but it actually made my problem worse.  Not realizing the attachments weren't there, that was run which removed the associations.  Now, we have to re-import the database, and hopefully they will be there.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GigaWatt on July 12, 2019, 07:53:42 PM
Delete everything, import old DB, import all files from backup (all of them), run repair_settings.php? (https://wiki.simplemachines.org/smf/Repair_settings.php), correct URLs, paths, etc., load forum URL in browser, check if the forum is loading, if the attachments show up in posts and see if you can download them ;).

You can worry about the details later, just make sure the forum is up and running ;).

PS: When uploading the files, if you're doing it via FTP, make sure you have the FTP client set up in binary mode.
Title: Re: Help! Moved to a new host and attachments/uploaded avatars disappeared
Post by: GunDude on July 12, 2019, 09:12:20 PM
Thanks everyone for your help... It's up and working with attachments and all after re-uploading the backup.