Posted July 8th, 2008, in: Computer Problems and Fixes| Technology

Lately for extra cash, I have been helping people with WordPress installations, upgrades, theme-tweaks etc.

Recently I was asked to look into a disappearing dynamic navigation menu created using the plugin NAVT.

The menu ‘groups’ had completely disappeared from the dashboard and of course, from the site as well. Apparently, this happens fairly often with NAVT.  Not sure why.

All and all, I think NAVT is an awesome plugin.  It adds a drag-n-drop ajax interface to the wordpress dash for creating hierarchical navigation menus.  It also allows you to use xpath to replace your theme’s default navigation div with one created by the plugin.  With a little design magic, the result can be a super-slick dynamic menu with parent-child relationships between nav items.  Pages, Categories, Users, User-defined URI’s are all options you can add to “groups,” each group having its own CSS and XPATH settings which you can define.  Very well thought out.

Unfortunately, something went a little crazy with the database or something and the whole thing broke for this client.  So she got ahold of me.  The forums at NAVT suggested ‘resetting’ the plugin, which I eventually did, but my client had wanted to avoid this because the navigation she had set up was complicated and her site has a lot of content.  NAVT does have a backup/restore feature (again, very well thought out), but unfortunately, this would not work either, which is presumably always the case once your NAVT groups ‘disappear.’

Before resetting the NAVT plugin, I downloaded her entire WordPress database, just in case.

Now the only trace of her original navigation groups, and more importantly, the CSS and XPATH data created by the plugin are gone, except for the record of them in the MySQL backup.

I posted my drama to the NAVT forum and the author of the plugin was awesome enough to respond right away.  This is what I love about the WordPress community!

Re: Recover NAVT settings from MySQL Database Backup

Postby gbellucci on Mon Jul 07, 2008 4:11 pm

If you’ve restored a wp db the NAVT configuration is in the options table. NAVT options begin with ‘wpnavt_’. The navigation configuration for navigation groups are stored in an option in the format of a PHP array; the option name is ‘wpnavt_gconfig’. A similar array is stored for individual items called ‘wpnavt_iconfig’. To operate correctly, the ‘wpnavt_version’ number must match the plugin version number to prevent NAVT from attempting to convert the values in an existing option to the values expected for the plugin if the plugin version number is newer than the version in the option table.
I haven’t tried to perform this recovering of NAVT data via MySQL yet myself, but if you’re reading this and you you do try it, fail or succeed, please comment either here or over at the NAVT forum.  Share the knowledge!

If you found this information helpful, please consider making a donation. No amount is too small.

One Response to “Restore NAVT From MySQL Database Backup? CSS and XPATH?”

 
Martin wrote on October 14th, 2009 4:24 pm :

Thank you for this topic.

My setup:
MySQL 5.0 / WordPress 2.8.4
I’ll use this quick’n'dirty SQL to save my investment ;)

# create a backup table in WP-database

CREATE TABLE `wp_options_navt_backup` (
`id` int(11) unsigned NOT NULL auto_increment,
`option_id` bigint(20) unsigned NOT NULL,
`blog_id` int(11) NOT NULL default ’0′,
`option_name` varchar(64) NOT NULL default ”,
`option_value` longtext NOT NULL,
`autoload` varchar(20) NOT NULL default ‘yes’,
PRIMARY KEY (`id`,`option_id`,`blog_id`,`option_name`),
KEY `option_name` (`option_name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

# manual backup:

INSERT INTO wp_options_navt_backup SELECT ”,option_id,blog_id,option_name,option_value,autoload FROM wp_options WHERE option_name=’widget_navt’ OR option_name LIKE ‘wpnavt_%’;

REPLACE wp_options SELECT option_id,blog_id,option_name,option_value,autoload FROM wp_options_navt_backup ORDER BY id asc;

# This gives me a better feeling. If I don’t forget to start it in time …

Leave a Reply