Support

UNiTE, Remote CLI, eXtract Wizard

#3511 Restore error using Kickstart

Posted in ‘UNiTE and Remote CLI’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

PHP version
n/a
Tool
UNiTE
Tool version
n/a

Latest post by nicholas on Monday, 23 November 2009 07:26 CST

user6254
In process of restoring a live site to localhost, have taken backup and am using kickstart to restore locally but I keep hetting this error:

Error at the line 1123: INSERT INTO `stage_session` VALUES (blah, blah);

Query:INSERT INTO `stage_session` VALUES (blah, blah);

MySQL: Duplicate entry 'e57fd3385b9378189968e55e5dce7de9' for key 1

Stopped on error

Any ideas?

Thanks,

Liz

dlb
Liz,

That indicates that there are two records with a key field that is supposed to be unique. The jos_session table only holds temporary data about users that are currently logged into the website, so we can safely delete the duplicate.

You need to edit the /installation/sql/joomla.sql file and delete line 1123. Then you can restart the installation script and finish the restore.

Nicholas found that there were duplicate records being created under certain circumstances on a "step break" in the backup. When JoomlaPack pulls a group of 100 records from the table, then goes back for the next 100 records. That's the short version. :D I don't know what the status of the fix is.

Dale


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user7595
Hi Dale, I have the exact same problem and just happens to the jos_session table. Is there any way I can exlude the contents of the jos_session table to be saved into the backup?

I know that if I delete the duplicated entries I will have a valid backup however my client is not technical at all and he will have trouble with it.

I am using JoomlaPack 2.4.b2 (2009-10-23).

Thanks in advance.

dlb
Excluding the contents of the jos_session table is an interesting suggestion. No, it can't be done currently, but I'll flag this for Nicholas to see if he thinks it could be added.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

nicholas
Akeeba Staff
Manager
The current database filter implementation only allows completely skipping a table, not just its contents. This is a feature planned for no earlier than JoomlaPack 3.0, due to the modifications required to be carried out in the database backup engine.

However, your problem must have a cause. It's not wise to treat the symptoms when there is a cause.

Check this first: JoomlaPack automatically includes your site's main database. If you also include it in the Multiple Databases inclusion filter, you end up with double entries. In this case, you can simply remove the database definition from the inclusion filters.

The other idea is having tables of multiple Joomla! installation inside the same database. For example, let's say that a live site has tables starting with jos_ (which is the prefix used for this site) and some other tables starting with foo_ (of a previous or a parallel Joomla! installation). JoomlaPack will back up the tables starting with jos_ like this: jos_banners as akb_banners, jos_session as akb_session etc. The akb_ is a special marker which tells JPI to replace it with the prefix you enter. The other tables' names will be backed up verbatim e.g. foo_session as foo_session etc. If we restore the site and select foo_ as the new site's prefix, JoomlaPack will restore akb_banners as foo_banners, but later in the file there is also another definition for foo_banners (which was backed up verbatim from the original site's database). Since the table is created only if it doesn't already exist (now, it does exist), JoomlaPack Installer will skip over this and will attempt to INSERT the data. This is where an error occurs. In this case you should visit the Exclude Database Tables page in JoomlaPack and click the "Exclude non-Joomla! tables" link in order to avoid this double back-up of tables.

Sorry for the long and technical post, I tried to be as clear as possible. If you still have problems, feel free to post back.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user7595
Hi Nicholas sorry for my delay. I agree, my problem must have a cause however I can not figure out where is it coming from. My backup has no multiple inclusion filters, the only database getting backed up is the Joomla's site's database, in this case there no way I can have double entry for any table.

The only place where I get double entries is on the jos_session table, everything else is perfectly fine.

This can easily be fixed by manually removing the contents from the jos_session, which has no use for new instances of Joomla sites, but my client really doesn't want to manually interfere the restore process, which is completely understandable.

Would you have another idea what seems to be causing it?

:-(

dlb
Nicholas is going to be offline for a couple of days, he should be back on schedule on Thursday.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

nicholas
Akeeba Staff
Manager
Without a MySQL database dump (produced with phpMyAdmin) of the entire database the site is installed in, it's impossible for me to tell. As I said, the only reason for having exactly ONE table being double backed-up is to have it present twice in the database.

Here's one really f-in good piece of experience... On Linux, file casing matters. ABC is different to Abc and different to aBc. MySQL stores each table as disk files. If you have jos_session and JOS_session, they can both be stored as two distinct sets of files and both can happily co-exist on your database. Here comes the pain... Your site's prefix is jos_. So, the first is stored as akb_session and the other one as JOS_session. Try restoring them on Windows. Bummer. On Windows filename casing is unimportant. Both tables would try to write to same sets of disk files, namely jos_session. During the first run, the akb_session table would be restored to jos_session as expected. When the JOS_session CREATE TABLE command is being processed, MySQL would note that the file already exists, therefore the table already exists and restoration would fail. This has actually happened to me a few months ago. I can only check if we have such a case with a MySQL dump.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!