I do local WP development on a WordPress Multisite instance. What is the best way to move theme settings from there to the live instance? By theme settings I am talking about widgets and theme options.
Leave a Reply
You must be logged in to post a comment.
Answer 1 is not the best way… it’s the old way.
The best solution going which I have found, and use regularly for moving site from local dev to live is at http://pluginbuddy.com/purchase/backupbuddy/. It backs up everything, including databases and plugins, and lets you restore a site or migrate an entire site to a new server. You don’t even install WP on the new server because backup buddy does it all. A full migration from local to live takes about 10 minutes.
For being able to save your widget setup to each specific theme you have under a WP install the plugin at http://wordpress.org/extend/plugins/widget-saver/ is most excellent.
The best way would be to create an SQL export dump of your database for that site more spesificly the options table of the database.
I’m going to assume that you’re doing things correctly, which means that you’re using
register_setting()
to create a single, options-array DB entry.Thus, assuming your Theme slug is
mytheme
, and your DB entry is namedtheme_mytheme_options
, you simply need to export the following from wp_options:theme_mytheme_options
theme_mods_mytheme
Export them from the development SQL server, and then import them into the production SQL server.
You could probably even write an exporter/importer for the process (maybe take a look at the WordPress importer Plugin as a reference?).
EDIT
MultiSite-specific: you’ll need to know the ID of the network site. The table name should be in the format:
{network}_{siteID}_options
.