WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Can you export and import Custom Sidebars?

[Resolved] Can you export and import Custom Sidebars?

  • I am migrating to a new host. Everything migrated over pretty well to the staging area. However my custom-sidebars have all been reset.

    Is there a way to export/import the sidebar settings so I don’t have to manually re-build my sidebars from scratch? I still have the site live on the other host with my original Custom Sidebars intact.
    …. I have a pretty large site with 19 Custom Sidebars setup.

    Thanks for the great work!

    https://wordpress.org/plugins/custom-sidebars/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Predrag Dubajic WPMU DEV Support

    @wpmudev-support1

    Hi @smellcoffee,

    I hope you are well today and thank you for your question.

    You can export your custom sidebars settings by exporting the .sql file from your old WordPress database selecting “cs_sidebars” and “cs_modifiable” options from the wp_options table where wp_ is a WordPress table prefix.

    Import the custom sidebars settings by importing this generated sql file containing “cs_sidebars” and “cs_modifiable” options in your new WordPress database.

    To import / export widgets from your old site to new site try using the following plugin.

    https://wordpress.org/plugins/widget-importer-exporter/

    Best Regards,
    WPMU DEV

    Hi @wpmu DEV

    Yeah!

    Thank you for the how-to.
    I’ll give it a go.

    Plugin Contributor Predrag Dubajic WPMU DEV Support

    @wpmudev-support1

    You are most welcome, if I can be of any further assistance please don’t hesitate to ask 🙂

    Hi @wpmu DEV
    I´m trying to do the same thing, but when importing the sql file into my new wordpress database, I get the error message: #1050 – Table ‘wp_options’ already exists. I didn´t change anything in the settings while exporting/importing.
    I hope you can help me out with this.
    Thanks,
    Floortje

    Plugin Contributor Predrag Dubajic WPMU DEV Support

    @wpmudev-support1

    Hi Floortje,

    Thanks for posting on the forums.

    I think you are exporting and importing whole wp_options table, you don’t need to export/ import whole wp_options table for exporting / importing custom sidebars settings.

    To import / export only the Custom Sidebars settings execute the following sql query in your PHPMyAdmin sql executer.

    SELECT * FROM<code>wp_options</code>WHERE option_name = "cs_sidebars" or option_name = "cs_modifiable";

    Then on the generated results page select all the two found rows by clicking on the “Check All” text and export it by clicking on the “Export” text as described in the following reply.

    http://serverfault.com/a/300342

    If by any chance according to the configuration of your PHPMyAdmin the exported sql file contains the wp_options table creation code as following

    CREATE TABLE 'wp_options' (

    then before importing just change the above code in the generated sql file as below so that when importing it won’t generate “Table ‘wp_options’ already exists” error message

    CREATE TABLE IF NOT EXISTS 'wp_options' (

    Cheers,
    WPMU DEV

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Can you export and import Custom Sidebars?’ is closed to new replies.