Migrating Joomla

Internet
Tools
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

The one that doesn't kill you makes you stronger - Neitzsche. When I was asked to upgrade the hosting plan which costs me $ 84 per year, I would have upgraded happily few years ago because it was monetised with Google Adsense then, but since the blogs are in Tamil (Non-English language) the Adsense account was revoked. So for the past few years I was spending on the webhosting as a means of hobby / entertainment out of my pocket. But this new plan is not that much worthy to spend, considering the fact that my blogsite had crossed its prime time and the number of visitors had come down considerably. So I just want to have a hosting just to save my domain name for future.

 

I had been with this webhosting for past 8 years. So considering the amount of work & the size of the files uploaded over the period of time, moving out of the current hosting seemed laborious. But I have to move out. So I started looking for the ways to have a smooth transition. The following tools came to my help. I did this migration multiple times to get a hang of the process before I choose the final account to migrate. I thought that what I had undergone might be helpful to someone interested, that resulted in writing this manual.

The steps involved in this activity are:

1. Creating a local copy of your website
1.a - Creating the backup of your website using Akeeba
1.b - Installing WAMP server
1.c - Restoring the site locally using Akeeba backup

2. Cleaning the files

3. Reuploading them to the new webhost.


Tools needed:-
1. Joomla Akeeba Backup Component
2. WAMP server
3. Filezilla FTP client.

All the above mentioned are freewares.

1. Creating a local copy of your website

1.a - Creating the backup of your website using Akeeba

To initiate the migration, we need the consolidated copy of the website that can be moved to other webhost. Akeeba Backup (Free edition is fine) came to my rescue as I was able to create a backup of my site.

Install the Akeeba Backup component and configuration is self intuitive. We can backup the whole site as such or exclude the directories (JDownloads and media files) or even backup only the data base. It creates the bundle of files, database and the restoring script together in *.JPA format. In my case I excluded the *.APK files because I already had them backed up in my laptop. So the backup of the whole site including the pages of the online comics (Flipping books) came to 1.2 GB.

Download the *.JPA using FTP client in Binary format. Browser download might sometimes corrupt the file to an unreadable format, so it is better to use a FTP client to download the backup of your site to the local desktop.

1.b - Running your website locally, offline from your desktop - (Screenshots 1 - 9).

Download and install WAMP server to run your website from the desktop. The installation will have a "www" folder whose content can be accessed via web brower. So you can dump your website into the 'www' folder under the WAMP server.

This step is optional, but you might want to have the website cleansed before you move to other host. The advantage of having the WAMP server as playground is that you can practise the "restoration process" many times till you get comfortable before you upload the backup site to the external webhost. Having a local copy will help you in playing around / doing R&D with the codes before you make changes to the actual "live" website. If you don't want to see a "local" version of your website you can skip installing this WAMP server.

1.c - Testing the restoring process in your local computer:
You need to create a local blank database (using phpMyAdmin) to populate the Joomla database. Normally the server is "localhost" and user is "root" and password is "<blank>"

Place the downloaded *.JPA file (whole backup of the website) and the kickstart.php file (downloaded from Akeeba Backup website) in the WWW folder of the WAMP server. Call the "kickstart.php" file from your browser. Typically the path will be "http://localhost/<folder name>/kickstart.php".

i. Select the JPA file from the download.
ii. Many times I struggled with the next step with FTP. Later I found that since the JPA file is placed locally, I can choose the "Write Directly" option, which worked like a charm.
iii. Click "Restore"
iv. You will be asked the server name, database details, database user name and password. Give the values - "localhost", "<database name>", "root", leave the password field blank. The Joomla database will be copied into the local datase with the same structure and contents.
v. If all goes well, then there will be a cleanup message and after that you'll be prompted to set your administrator password and your site is locally active without internet access. All the modules, components and images you had in the external webhost will be available offline with the same configurations.

2. Cleaning the files:-

Since I had used many nulled scripts and templates, there were so many compromised files in my website. You can open the "nulled scripts" php files and look for encrypted codes and remove them. If you are sure that the files from the templates and components are fine with, then look for the potential threat files with the extensions *.shp, *.php and *.sjp. I found a file called asc.php in the "images" folder which was suspicious and when I opened it I could see the file full of encrypted php codes. Since I was in a paid hosting, the webhost provider didn't bother about the malicious files.

Many webhostings that offer free webhosting are very strict and they immediately suspend your hosting account if they come across any compromised codes, *.shp (php shell injection). So it is better to check and remove these files manually before reuploading the same to the new webhosting.

3. Reuploading the website to the new hosting:

Depending on the upload size limitations of your new host, you can choose the appropriate way.

1. If your new webhost doesn't have any restriction on the size of the upload, then you can create a backup of the "cleaned" site again by using Akeeba Backup from the local copy and upload it to the new webhosting along with the "kickstart.php", start executing the kickstart and replicate the process again.

2. If your new webhost has the file size restriction (normally a maximum of 10 MB) and provide "Softaculous" one click installation of scripts, then you install the Joomla first using that option. The using the FTP to upload the existing structure of modules, components and images by dragging and dropping the entire set of files into the "Joomla installation" folder of the remote webhost. Login to the administrator console of the Joomla and choose "Discover" and install the custom lugins, modules and components. If the new site is having identical modules, components of the old site, then linking to the database with old contents will be easy.

3. Extract the database from the current webhost or from the local copy. You'll need this to upload this to the new web hosting service. It is better to have it gzipped while exporting so that the size can be significantly smaller than uncompressed. (Screenshots 10-12)

4. Using the cPanel of the webhosting, check if you can create another database. If you can create a new one, please create a blank data base and "import" the old database in SQL format. Modify the "configuration.php" by replacing with the new database name, database user and password.

5. If all the previous steps are done properly, when you login to the new Joomla site, you can see the old site's components, modules and contents. Depending on the scenario, little modifications of the files / filepath may be needed.

Screenshots:-

Related Articles