How To Make My Development Site Live From A 'sub-folder'
So, you have been working / updating your new website in a sub-folder on your server and it's now time to take your old website offline and replace it with your new website. This can be achieved with a couple of easy steps which we will outline below.
For this tutorial our main (old) site will be in the root of out web space 'home/(user)/public_html/' and or new site will be located at 'home/(user)/public_html/new_site/'. We will be using FileZilla to perform the 'move' and a note pad application called Notepad++ to edit our 'configuration.php' file of our new website.
- Location of current old site: 'home/(user)/public_html/'
- Location of new site: 'home/(user)/public_html/new_site/'
- FTP client: FileZilla
- Note pad application: Notepad++
Step 1 - Move Old Website 'out of the way'
We first need to 'clean up' our 'public_html' folder that contains our old website, we do this by connecting to our web space using FileZilla and navigating to our 'public_html' folder. We will then create a new folder called something like 'old_site' where we will put our old websites files.
- New folder destination: 'home/(user)/public_html/old_site/'
Within FileZilla we need to select all of our Joomla files and folders (with the exception of 'old_site' and 'new_site'). With all of the Joomla files and folders selected we will then drag them into our 'old_site' folder that we just created. This process should only take a couple of seconds but if you have a large site (lots of extensions installed, images, PDFs etc) it can take longer.
Step 2 - Move our 'new website' to our 'public_html/' web space
We then need to navigate to the location of our new website (home/(user)/public_html/new_site/). We will need to select all of the Joomla folders and files within our 'new_site' folder and drag and drop them to the '..' located above the first folder within our 'new_site' folder (usually the 'administrator' folder). Again this should only take a couple of seconds depending on the size of the new website.
Editing the 'configuration.php' file of our new website
There are two lines within our 'configuration.php' file that we need to edit. In order to do this we need to right click on our 'configuration.php' file and select 'View/Edit' within FileZilla. The two lines that we need to edit relate to the '$log_path' and the '$tmp_path'
The '$log_path' and the '$tmp_path' are currently set as follows:
- public $log_path = 'home/(user)/public_html/new_site/logs';
- public $tmp_path = 'home/(user)/public_html/new_site/tmp';
We need to change both values as follows:
- public $log_path = 'home/(user)/public_html/logs';
- public $tmp_path = 'home/(user)/public_html/tmp';
You will then need to save your edits and re-upload your 'configuration.php' file back to the server, this is simple as all you need to do is click the 'FileZilla' icon on your tool-bar and you will be prompt to upload the edited file to the server.
Once the file has been re-uploaded you can then view your new website at your domain (or browse to you Intranet to see the new website).
It is never advised that you completely delete your old website so you should make sure you have a backup (both database and folders and files). Once you have taken a backup you should move the 'old_site' folder out of 'public_html'.
You should double check the 'new_site' folder in case you missed any folders or files, if it is empty you can delete the folder by right clicking it within FileZilla and selecting the 'Delete' option.
All done - if you need any help with any aspect of this tutorial please don't hesitate to get in touch, our one off service fee can get your new website located in a sub-folder live within minutes.
PS: Don't forget where we use '(user)', you should use your account's username and NOT '(user)'.