News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Can't re-install 3.2 - sql error messages

Started by steve30000, 11.09.2014 23:53:28

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

steve30000

I seem to have gotten my system into a state of confusion.  I had jDownloads 3.2.11_beta_j32 installed on my Joomla! 3.3.3 site.  I then made the mistake of seeing that there was an updated download on your site without realizing it was for the v1.9 series of jdownloads. I installed the v1.9 on top of the 3.2.11 which caused some error messages when I tried to access the jdownloads component.  I then uninstall the v1.9 component and tried to re-install the v3.2.11 component. When trying to install, I get the following error message:

1050 Table 'xxx_jdownloads_cats_backup' already exists SQL=RENAME TABLE `xxx_jdownloads_cats` TO `xxx_jdownloads_cats_backup`

I then tried to rename the existing cats_backup file so that it could be created again.  I then ended up with the following error:

xxx_jdownloads_cats.frm' (errno: 2) SQL=RENAME TABLE `xxx_jdownloads_cats` TO `xxx_jdownloads_cats_backup`

which prevents the installation from completing.

Is there anyway to fix this?  Thanks.
  •  

ColinM

Hi
Yes a challenge! But solvable OK.  First a few background things.
 
1. In common with most components jDownloads will update an existing version to a more recant release in the same series, but it will not reinstall over the same version. 
2. When uninstalling jDownloads it purposefully leaves all the data and the database info intact. There are half a dozen or so tables in the database such as 'xxx_jdownloads_cats'.  The data itself is in directories (site)/jdownloads and (site)/images/jdownloads.
3. To make a backup of just the jDownloads info then it is necessary to make copies somewhere of the two directories and all their contents, and also of the database tables.  Making copies of the directories is quite straight forward and there are many ways of doing this.  The simplest way for the database items is to use the jDownloads Tools -backup.  This copies the contents of the jDownloads database tables into a txt file on your local PC.  Restoration is the reverse, namely copy back the saved directories and use the jDownloads Tools-restore.
4. A Download consists of two parts: the actual download file itself, and the ancillary information such as images, price, language, access level info, permissions and so on.  This ancillary information, or in the case of images, mp3/mp4 files the links, are stored in the database tables.

Now your challenge is that the state of the jDownloads database tables is uncertain.  The way forward depends partially on how much data (number of Downloads) you have already uploaded and the additional information associated with each Download. If it is a large number, say more than 100 and you have put in a lot of auxiliary information such as images, price info and so on then it is worthwhile endeavouring to save and reuse the database tables.  The problem is not the number of Downloads themselves but the amount of ancillary information.  The main data files are readily saved of course by simply renaming the two key directories.  The jdownloads directory is the key one as we can make use of the jDownloads monitoring function to restore all of the categories and main files.

So first make copies of the two main directories.  Directory (site) /jdownloads is vital. Directory (site)/images/jdownloads is only useful if you have pictures and mp3/mp4  that you want to use again.

The simplest case is when only a relatively small number of Downloads have a significant amount of ancillary information associated with them.  In that situation is is easiest to simply start again.  Initially uninstall all the jDownloads  plugins and modules and then the Component.  Next you need to remove the relevant database tables.  Here I will assume your site runs with CPanel facilities and that you can access phpMyAdmin.  The pic below, DatabaseTables01.png lists the relevant tables but without my site specific prefix.  Each table has jdownloads in its title.  There is also a Drop button for each table so use that to remove each jdownloads table in turn - be careful as this is not reversible and of course do an entire site backup using say Akeeba before doing anything else.

After doing the above and renaming the two directories out of the way you will be able to reinstall jDownloads OK.  To get all the download main files and categories in place then ensure you have auto monitoring in your configuration and that the category/download naming styles are set as you desire. Next replace the newly created (site)/jdownloads directory with the one that was saved - if you have hundreds of main files then do a few hundred at a time.  Now the tedious bit is to set up the ancillary information by editing each download, and setup your User Group Settings as needed.

The more complex cases need a knowledge of the database tables - which is a different ball game needing specific info that cannot be generalised.

Oh and did I say the lesson is of course - take backups!  Some backup facilities offer automated restore points which can be most helpful.

Colin



[gelöscht durch Administrator]
Colin M
  •  

steve30000

Thanks for the info.  I was hoping it would not be that complicated as I have over 7000 files and hundreds of directories in the jdownloads configuration.

I actually did have a backup from before I updated of the v1.9 site before I updated to 3.2 so I ended up just restoring that and will go through the upgrade process again as that seemed to go pretty smoothly.

Thanks again.
  •