Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: jbridges87 on July 11, 2020, 04:54:03 PM

Title: Best method to move install directories
Post by: jbridges87 on July 11, 2020, 04:54:03 PM
Hey ya'll, I originally installed my forum in public_html, and I'd like to move it to a folder titled 'forum'.

I have a bunch of images linking back to specific directories on the server, and was hoping I wouldn't need to manually edit every single post to point to the new directory path.
So as the titled states, what's my best bet for moving my install. Is their a tool or recommended method?
Title: Re: Best method to move install directories
Post by: Sir Osis of Liver on July 11, 2020, 05:25:23 PM
Should be able to do it with a database query, or if the db is not too large, you can dump it, do find/replace in text editor and import it back to prod db.
Title: Re: Best method to move install directories
Post by: jbridges87 on July 11, 2020, 05:55:25 PM
Sorry, I'm not really sure what you're saying.

Would you be able to explain in layman terms, as web development isn't my area of training? Thanks
Title: Re: Best method to move install directories
Post by: Sir Osis of Liver on July 11, 2020, 06:29:08 PM
Are you moving the images or the forum? 
Title: Re: Best method to move install directories
Post by: jbridges87 on July 11, 2020, 07:25:52 PM
I suppose I could keep the image folder under public_html, so I wouldn't have to modify all of the directory paths.
In that case, I would just be moving the forum.
Title: Re: Best method to move install directories
Post by: Sir Osis of Liver on July 11, 2020, 07:34:10 PM
Assuming we're talking about posted links to external images (not attachments), that would seem to be the simplest way to do it.  The links are included in the post text in _messages table.  You can run an sql query in phpmyadmin to find a specific path and change all occurences, or you can export the db as .sql file, load it into a text editor and just do a find/replace to update the links.  Leaving the images where they are is a lot easier.
Title: Re: Best method to move install directories
Post by: jbridges87 on July 11, 2020, 08:59:33 PM
So I have images that I uploaded to various directories under public_html/images, then I have them linked to within posts and articles.

If I leave them all in the Images directory, I should just be able to move all of the SMF installation files into the newly created forum directory?
Title: Re: Best method to move install directories
Post by: shadav on July 11, 2020, 09:10:17 PM
more or less yes....

depends on how you linked to them....
did you use full url or path or did you use
../images/filename
if the last one then you will need to change them either to full url/path or add however many ../../ are needed to go back to the image directory
Title: Re: Best method to move install directories
Post by: Kindred on July 11, 2020, 09:17:52 PM
See the faq article moving a forum.

Title: Re: Best method to move install directories
Post by: jbridges87 on July 11, 2020, 09:20:11 PM
Here's an example of what I did;

1. Upload image to public_html/Images/example A

2. From within article, I typed out the full path where the image was on the server, highlighted the text, and selected 'insert image'.
Title: Re: Best method to move install directories
Post by: shadav on July 11, 2020, 09:28:33 PM
then no, it shouldn't be a problem

[edited to say] it shouldn't be a problem if you leave the image directory where it is and move all of the smf files into the forum directory
Title: Re: Best method to move install directories
Post by: jbridges87 on July 11, 2020, 09:37:33 PM
Alright, so I checked the FAQ, and the only article I found was moving hosts.

So my issue is that I don't know what files are part of SMF and which aren't. My public_html directory has many directories and files that aren't included in the standard SMF install [I downloaded v2.0.17 to compare files/folders.]

My research of previous articles suggests I should be able to move all of the SMF forum/files into the new directory, in this case 'public_html/forum', and then place the repair_settings.php within the new directory, run it, and it should be able to fix the paths.

I'm just not sure exactly which files/folders to move...
I attached a list of all the files/folders in my public_html.
Title: Re: Best method to move install directories
Post by: shadav on July 11, 2020, 10:15:15 PM
I used your image and blacked out the ones that aren't related to smf
put a ? next to ones that may be modifications, but doubt it
assuming gallery is a gallery mod and the tp-FILES are tiny portal mod

adn sitemap may or may not be part of smf.....either way you'll need to put one into the forum directory and edit it to match the new forum location or if it's part of a mod, update the mod and create a new one
Title: Re: Best method to move install directories
Post by: jbridges87 on July 11, 2020, 10:30:04 PM
The sitemap is part of the optimus mod.
The safari, and other png/svg files you see are for my favicon. They were automatically generated by a third party site, and I had directions to put the files into the public_html.

Gallery is definitely the gallery mod, and the tp directories are in fact from Tiny Portal.

I will try moving all of the visible files shown in your post into my forum directory, and then run the repair_settings.php.
Should that do the trick?
Title: Re: Best method to move install directories
Post by: shadav on July 11, 2020, 11:12:13 PM
it should.....depending on what all mods you have installed you might need to then also go into their settings in the admin and make changes....

can't remember which ones though, sorry
Title: Re: Best method to move install directories
Post by: jbridges87 on July 12, 2020, 12:13:00 AM
Success!
Thanks for your assistance.
Title: Re: Best method to move install directories
Post by: shadav on July 12, 2020, 12:26:30 AM
woho  ;D