Restoring Horde / Roundcube address books

jack01

Well-Known Member
Jul 21, 2004
200
0
166
Hi, really hope you can help!

How does one restore a user's address books for horde and roundcube?

I found the horde.sql and roundcube.sql files in the user's /backup/.../homedir/ folder, and I know there are /var/lib/mysql/roundcube and .../horde folders, but how do I integrate the user's data from the .sql files?

Any information/advise is welcome.

Thanks in advance

Peace.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hi,

Actually, horde has it's own database that the user wouldn't have backed up, although any backups you make for /var/lib/mysql would have the horde database backups.

If you have ever run /scripts/fullhordereset, you would also have a backup file at /var/cpanel/horde with the name horde.backup.sql.########## (where # are numbers).

If you open up the file to view it, at the very bottom you'll get something like this:

LOCK TABLES `turba_objects` WRITE;
/*!40000 ALTER TABLE `turba_objects` DISABLE KEYS */;
INSERT INTO `turba_objects` (`object_id`, `owner_id`, `object_type`, `object_uid`, `object_members`, `object_name`, `object_alias`, `object_email`, `object_homeaddress`, `object_workaddress`, `object_homephone`, `object_workphone`, `object_cellphone`, `object_fax`, `object_title`, `object_company`, `object_notes`, `object_pgppublickey`, `object_smimepublickey`, `object_freebusyurl`) VALUES (some values here),(some values here),(some values here);
/*!40000 ALTER TABLE `turba_objects` ENABLE KEYS */;
UNLOCK TABLES;


You could either run these commands in the mysql prompt on the system by doing the following series of commands:

mysql
\u horde

(paste in mysql shell the contents you copied from sql for turba_objects section)


Alternatively, you could log into PHPMyAdmin in WHM as root user, select the Horde database, select the turba_objects table, select SQL and paste the information from the sql file's turba_objects section into the field and then click the "Go" button.

Please do make a copy of the horde database prior to doing this. I'd suggest you make the copy in root shell by just doing:

cd /var/lib/mysql
cp -R horde horde.bak091011


Also, you would probably want to check the table turba_objects in PHPMyAdmin first and Browse it to see if address book items exist for other users before using a possibly old .sql file in /var/cpanel/horde, since you might wipe out other user's address books. The sql contents you copy will have the address book contacts in this section:
VALUES (some values here),(some values here),(some values here);

As such, if you see a major discrepancy between the current listing when you Browse turba_objects and the VALUES area, you would need to find a way to integrate those two.

For Roundcube, I'm not as sure, so I'll leave that up to a Roundcube expert.

Thanks.
 
Last edited:

jack01

Well-Known Member
Jul 21, 2004
200
0
166
Well...cpanel does backup users' horde and roundcube databases, but it seems to extract data from the main horde/r.cube databases. Hence the backed up horde.sql and roundcube.sql files that are created per user during backups.

So why on earth would they not provide an easy means of restoring these???

Having to 'integrate' the data manually risks overwriting good data in the main db - simply not worth it, so what is the point of the backups?

:confused: :eek: :confused: :eek: :confused: :eek:

Thanks anyways cpaneldanielle.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
How does one restore a user's address books for horde and roundcube?

I found the horde.sql and roundcube.sql files in the user's /backup/.../homedir/ folder, and I know there are /var/lib/mysql/roundcube and .../horde folders, but how do I integrate the user's data from the .sql files?
The two SQL dumps specified are restored automatically when restoring a full account backup; restoring full account backups is possible via WHM or via root SSH access; it is not yet possible for end-users to do this via the cPanel control panel.

If you prefer to have a specific feature for end-users to restore horde and roundcube SQL dumps (e.g., a new feature that could be placed at "cPanel: X3 > Files > Backups"), I would consider posting a feature request in the following area on our forums:
Feature Requests for cPanel and WHM - cPanel Forums