It is always nice to have an offline copy of your Joomla website. This is how I've done it:

  1. Gather info from your website
    • Version of PHP
    • Location of your website on the host provider
    • Version of Joomla
    • Your PHP database name
  2. Setup a VM in VMware Workstation
  3. Install XAMPP
  4. Create the PHP database
  5. Install Joomla!
  6. Configuration of Joomla!
  7. Restore a backup of your Live database
  8. Update the Configuration.php file

 

Jump to this section if what you're doing is to copy a new version of Joomla

 

Recommendation: Download the Visual Studio Code from here: https://code.visualstudio.com/download, and use it as a replacement for Notepad

 

1. Gather info from your website

From your live website, this is the info you need to know

  • Version of PHP; Visit Plesk >> Websites and Domains >> PHP settings; at the time of writing this article I'm running 7.4.14

 

  • Location of your website on the host provider;  Still in Plesk, go to File Manager >> httpdocs >> and open the "user.ini" file and take note of the "open_basedir" location, on my case D:\Domains

 

 

  • Version of Joomla; still in Plesk, go to Websites & Domains >> Applications and take note of the version of Joomla that you're running, 3.9.24 on my case
  • Your PHP database name; go to your Jooomla >> System >> Global Configuration >> Server tab, and take note of the PHP database name,  on my example is Naz783WP

 

 

2. Setup a VM in VMware Workstation

Open the "Virtual Network Editor" of VMware Workstation and and take note of how you have configured the "Bridge Network". On my case I set it so that any virtual machine connected to VMnet5 will behave as if connected to the physical LAN of my house router

Given the fact that I'm hosting my Joomla on a Microsoft IIS server, I choose to replicated by having also a Windows server. Create a Windows Server 2012 virtual machine on VMware Workstation, and make its network connection to be on "VMnet5, which on my case translate to "Bridge", hence the VM will have visibility to your local router

 

 

After the installation, run "msconfig" >> Tools >> Change UAC Settings and set it to "Never notify". We need the User Account Control to be off for our project

 

Then add a "100 GB" size to your VM, initialise it, format it and set it with the label D:\, this is the one that will host our website, matching the drive letter of our host provider

Finally, configure the "Shared Folders" option of your VM so that it can see your host, where most likely you'd save the backup of your website downloaded from Pleak

 

3. Install XAMPP

XAMPP is a wonderful distribution that contains all-in-one Apache, MySQL, PHP, etc, making it a lot easier to install a web by using XAMPP rather than by acquiring all separate components together. On your Windows VM, visit this link and download the version of XAMPP that has the same version number of PHP of your website, on my example 7.4.14

 

 

  • Choose to install ALL components
  • For the installation folder of XAMPP use D:\Domains
  • After the installation, open the control panel and start both Apache and MySQL

 

Click on the "Config" button and set these two services to auto-start

 

Finally, visit http://localhost/dashboard/ and you shall see XAMPP up and running

 

4. Create the PHP database

Before going any further, we need to create a PHP database to host our Joomla site, so visit http://localhost/dashboard/ and click "phpMyAdmin" on the top-left corner. Once in there choose Database >> Create database and enter the name of your PHP Joomla database that you gathered at the beginning of this article, on my example "Naz783WP"

 

 

 

5. Install Joomla!

Download Joomla from this link https://downloads.joomla.org/ ensuring that you download the same version that you have on your live website (on my example 3.9.24). Create a folder matching your Joomla version inside the httpdocs folder of XAMPP, we basically are going to have one Joomla folder per version installed

 

 Extract the contents of the previously downloaded zip file of Jommla into its appropriate version number

 

 

6. Configuration of Joomla!

After the extraction, visit (or whichever the version number you installed) http://localhost/Joomla3924/installation/index.php and fill in the details for the initial installation 

 

 

For the database page, enter the name of the database that you previously created, and use the username "root" with a blank password

 

 

Finally, on the overview page, choose to install "None" sample data and hit on the install button

 

 

To be able to access the "Administrator" section, you need to first remove the "installation" folder

 

To ensure that everything works, logon to Joomla with the username/password that you created during the installation wizard

 

 

7. Restore a backup of your Live database

Use the Backup Manager utility within Plesk to create a FULL BACKUP of your website, and then download the zip file

 

 

Locate the "sql dump" backup of the PHP database, and once you locate the file visit the phpMyAdmin on your localhost and choose to import that file on the PHP database

Leave all the other options for the import as default, and then click on "Go"

 

 

Look also on your plesk backup for the "httpdocs" folder, and copy all of its contents and paste them into your "Joomla3924" folder, overwriting any files (replace the files in the destination) and effectively making your Live Jomla version offline

 

And lastly, visit our offline site at 

 

 

8. Update the Configuration.php file

Open the "configuration.php" file from the root of httpdocs and carefully looks for the strings $log_path and $tmp_path and update them accordingly to your new offline location

 

 

 

 

 

 

 

 

 

 

 

Finally, though your FTP VM will have been assigned an IP form the DHCP pool of the router, configure on it an Static IP which is outside of that pool. On my case, being on the 1921.168.3.0/24 network that I am, I'll use 192.168.3.71

Check your Internet connection, and that your VM shows up on your router, and then we're good to go

 

 

2. Install FileZilla Server

The FTP server of choice that I'm going to use is FileZilla, you can get it from here: https://filezilla-project.org/download.php?type=server Install the application as a "service", ensuring that it starts if user logs on (apply to all users by default)

 

After the installation the app will open. Enter on it a super-strong password for the admin user.

  • Configure the Windows Firewall to allow the FileZilla app
  • Edit the settings of FileZilla an enable FTP over TLS support
  • Visit the Security Settings of your router >> Firewall >> Port Forwarding and forward FTP traffic to your local FTP

 

  1. Create a folder on the server called "JOOMLA_FTP"
  2. Click on Groups and add "Nazaudy_FTP" group
  3. Give all access to that folder to the group
  4. Create a user called "nazaudyftp" and add to the group
  5. Enter a super strong password for that user

You can use this site to test it all: https://ftptest.net/ 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1. Setup a FTP virtual machine using VMware Workstation

On your PC or macOS, fire up VMware Workstation and create a new Virtual Machine for Linux "CentOS 8 64-bit". I got to download of the 8.3.2011 (the latest at the time of writing this article) from here: http://mirror.bytemark.co.uk/centos/8.3.2011/isos/x86_64/ This will be the VM that will receive the copy of your Joomla website. Make sure you create a virtual disk big enough to host your site and future expansion of it. I went ballistics and create a 100GB hard drive, yeeehaa

 

When installing the VM, ensure you set the network card to be connected at startup, otherwise you'd have to do some post-installation commands for it to be up

After installation, run this command to user the terminal with admin privileges, and then update the system afterwards

su root
yum -y update

 

Install Webmin 1.9

Either follow my article here    or run this command on your VM:

wget http://prdownloads.sourceforge.net/webadmin/webmin-1.970-1.noarch.rpm
yum install webmin-1.970-1.noarch.rpm
firewall-cmd --set-default-zone=trusted
firewall-cmd --get-default-zone
firewall-cmd --zone=trusted --add-port=10000/tcp --permanent
firewall-cmd --reload

 After that visit the Webmin site here: https://localhost:10000/ and logon with your root account

 

 nmcli devicenm

 

 

References

Use Joomla! on your own computer https://docs.joomla.org/J2.5:Use_Joomla!_on_your_own_computer

Tutorial Copying a Joomla! Website https://docs.joomla.org/Copying_a_Joomla_website

Move your site to another server https://forum.joomla.org/viewtopic.php?t=187461

Backup basics for a Joomla! Web Site https://docs.joomla.org/Backup_Basics_for_a_Joomla!_Web_Site 

 

 

 

 

 

Print Friendly, PDF & Email

Comments powered by CComment