Migrate only the Menus table in Wordpress

Can someone help me with the name of the specific database table which relates to menus in Wordpress?
Any help appreciated.

The menu items are post types, so they are stored in the posts table along with all the other post types such as post, attachment, revision, etc. The information about this post type is stored in the postmeta table.

1 Like

Thanks for that, so to make a re-ordering of menu items take effect on the live site I would only need to migrate the posts table as in the attached screenshot right?

I have never migrated just part of a WordPress database, so I don’t know what effect doing this would have (make sure you have a backup, just in case you need to go back). Also, don’t forget that wp_posts contains all sorts of other ‘posts’ as well, not just the menu items.

I’m not sure exactly what you are trying to accomplish, but if you have custom menus that you can access in your dashboard > appearance > menus, you can reorder the items there just by dragging and dropping.

1 Like

Thanks for your response WebMachine,
I use a premium plugin wp-migrate-db-pro and it allows me to selectively migrate individual tables as shown in the previous screenshot. I’m migrating the database from my local dev to a staging server and then to production. It’s a lot faster to migrate just the table in question. I have re-ordered my menu items and I want this change to take effect on the live server, I just needed to know if I had selected the correct table to migrate.

It may be “a lot faster” but it is not something I would recommend doing. Databases are “relational” and most likely there are other tables involved. For example, a table could have the “last id” for an auto-increment field, a table could have index values based on other tables, a table could have foreign key values tying different tables together.

Feel free to try it, but IMHO it would be safer to import the entire database in one go regardless of how long it took. If you do try a partial import, for goodness sake do save a backup.

2 Likes

Thanks for your advice Mittineague - that’s something I didn’t know about databases.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.