I would like to move my SMF site from a sub-folder to my main/public_html directory

If you want to move your SMF site from a sub-folder to your public_html directory, you should follow these steps:

1. Move all the files from your current SMF installation folder to your public_html folder.

2. Edit the following lines in your Settings.php file, to suit your modifications:

$boardurl = 'http://YOURSITE.com/SMF_FOLDER';  # URL to your forum's folder. (without the trailing /!)
$boarddir = '/home/USER/public_html/SMF_FOLDER'; # The absolute path to the forum's folder. (not just '.'!)
$sourcedir = '/home/USER/public_html/SMF_FOLDER/Sources'; # Path to the Sources directory.

You can edit it through cPanel --> File Manager --> Find the file --> click on it's name --> click 'Edit'

You can also download it to your computer and edit it locally, then upload and replace the original with the one you've edited.

3. You should make the following changes in you MySQL database. Here is the path to do the changes:

Log in cPanel and click 'phpMyAdmin' from the Databases box. On the left bar select the database of your SMF installation --> Do the following changes:

In the table 'smf_settings' change to suit the following:

attachmentUploadDir : /home/USER/public_html/SMF_FOLDER/attachments

---------------------------------------------------------------------------
For example:

attachmentUploadDir : /home/USER/public_html/SMF_FOLDER/attachments

should become

attachmentUploadDir : /home/USER/public_html/attachments
---------------------------------------------------------------------------

smileys_dir : /home/USER/public_html/SMF_FOLDER/Smileys

smileys_url : http://YOURSITE.com/SMF_FOLDER/Smileys

avatar_directory : /home/USER/public_html/SMF_FOLDER/avatars

avatar_url : http://YOURSITE.com/SMF_FOLDER/avatars

In the table 'smf_themes' change to suit the following:

theme_url : http://YOURSITE.com/SMF_FOLDER/Themes/default

images_url : http://YOURSITE.com/SMF_FOLDER/Themes/default/images

theme_dir : /home/USER/public_html/SMF_FOLDER/Themes/default

theme_url : http://YOURSITE.com/SMF_FOLDER/Themes/classic

images_url : http://YOURSITE.com/SMF_FOLDER/Themes/classic/images

theme_dir : /home/USER/public_html/SMF_FOLDER/Themes/classic

theme_url : http://YOURSITE.com/SMF_FOLDER/Themes/YOURTHEME

images_url : http://YOURSITE.com/SMF_FOLDER/Themes/YOURTHEME/images

theme_dir : /home/USER/public_html/SMF_FOLDER/Themes/YOURTHEME

After that your SMF site should work like before.

* Please mind that in order to successfully perform such migration, there shouldn't be any scripts installed in your root folder at the time of the migration, since this may corrupt both applications.

You need help with an application? SiteGround is specialized in hosting and supporting more than 200 scripts. Sign up for our web hosting services and let us help you with your application, 24/7!