How-to: Copy a Joomla module

Be warned: In this tutorial we’re going to be editing your joomla database.  So make backup when we tell you to – and preferably also when we don’t tell you to.  Following this guide is, as always, on your personal risk.  Some knowledge of how to use phpmyadmin is a necessity to follow this guide. 

 

If, for some reason, you ever feel the need to “copy” a module from one joomla site to the other, this guide will explain you how to get it done.  As for most of these guides, these were written because of our personal experiences.  In this case, I was adding some modules to our Dutch gaming site Toretto.be   while checking something at the site of my company.  By accident, I deleted a module, and I had to find out how to retrieve that – rather important – module.  If you’re in that same spot, or for some other reason need to copy a module, here’s how it’s done.

The copying part

1.  At the “original site”, find the “modules” folder.  (note: in our articles, when we tell you to go to this or that folder, we assume that you know that you might have to FTP to that folder.)

2.  Find the folder of the module you need to copy, and download it / copy it. 

3.  Using phpmyadmin, go to your joomla database.  Navigate to your jos_modules table and export the data. (note: if, for some reason, you didn’t accept the default database install of joomla, find the whateverthehellyouusedasapreset_modules instead).

4.  Paste the export in notepad, and find the line about your module.  Copy EVERYTHING until the next line starts.  These lines start with (some number, some info, some info…)

 

The pasting part

5.  Upload / copy the folder you just copied / downloaded to the “modules” folder of the target site. 

6.  Go to phpmyadmin for that site, and go to the Joomla Database. 

7.  Find the jos_modules table.  Create a “back-up” of this site, by going to “actions”.  Rename the table there.  (Note: this will, of course, make all your module data temporarily unavailable.  Don’t say I didn’t warn you)
8.  Yet again, make an export of this table; paste in notepad.  I’m sure there’s other ways to do it, but I couldn’t add the single line with SQL commands due to some errors.

9.  Paste the line you copied in step 4.  Pay attention to the ”ID" of the line; you might have to change it to something not already used by a module. 

10.  Copy everything, and go to phpmyadmin again.  Import the data using the SQL method. 

Congratulations, you’ve just copied your Joomla module! 

Advertisements

5 thoughts on “How-to: Copy a Joomla module”

Comments are closed.