WordPress.org

Ready to get started?Download WordPress

Forums

NS Cloner - Site Copier
[resolved] Missing a database table when cloning (8 posts)

  1. FaceLord
    Member
    Posted 10 months ago #

    I make use of a custom coded plugin that creates a database table to store it's data. When I clone a site, that data is not carried over.

    Is it possible to include extra, or non-standard tables in the clone procedure?

    http://wordpress.org/extend/plugins/ns-cloner-site-copier/

  2. Never Settle
    Member
    Plugin Author

    Posted 10 months ago #

    What is the name of your custom table? Is it a global table? Or a table per site that your plugin is used in? As long as your table adheres to the WP table prefix ( like wp_ ) and includes the current site id (like wp_123_ for Site with ID: 123) then the Cloner will automatically clone it with that site and all the rest of that site's tables. Otherwise, there is no way for the Cloner to know about it, and a custom table could have a nearly infinite number of possible names to guess at. If you follow the convention wordpress uses for it's own individual site tables per site, the Cloner should have no problem automatically cloning those custom tables along with the standard ones. Hopefully that helps.

  3. FaceLord
    Member
    Posted 10 months ago #

    Thanks for getting back to me.

    The table in question is not a global table. There is one created for each site that the plugin is used on. The plugin adheres to the WP table prefix. In this case, the prefix is "bl0g_", therefor a site with an ID of 123 has a table named bl0g_123_client_info.

    Is it possible that it's not working correctly because I'm using a custom table prefix? Or could there be any other reason this isn't working?

    Oh snap... I just figured out the problem. It's an issue with the plugin. It has a column in it's table that defines the site ID. Probably under the assumption that all sites share a global table. Since the table is cloned to a new one, the blog site ID doesn't change.

    This should be an easy fix in the plugin now that I know what's happening. Sorry to unnecessarily bug you. And thank you so much for your time.

  4. Never Settle
    Member
    Plugin Author

    Posted 10 months ago #

    No worries! Glad you figured it out! Sometimes it just takes walking it through or bouncing it off someone to get all the pieces together. We do that all the time too! All the best!

  5. Jeff Smith
    Member
    Posted 8 months ago #

    I see this as well with the WooCommerce Advanced Notifications plugin. It creates "advanced_notifications" but not "advanced_notification_triggers"

    It's not too hard to create it with a SQL command, but it would be a little more convenient to have it work automatically.

    Any ideas?

  6. Never Settle
    Member
    Plugin Author

    Posted 8 months ago #

    Thanks, Jeff! Can you please double-check to make sure you are on the latest version (2.1.4.6). This was a tricky bug that had been lurking for a while now and we finally isolated it and release an update to fix it a couple days ago. However, if you're on 2.1.4.6 and it still isn't fixed we definitely want to know that and dive deeper into why. Please let us know either way!

    Here's the description from the last release notes:

    2.1.4.6
    Fixed critical bug that was causing incompatibilities with some plugins that install their own tables to the database and in some cases the cloning operation was leaving a single custom table behind in the clone. This primarily affected Calendar plugins or other plugins where the table name began with higher letters (a, b, c) after the prefix like wp_a*, wp_b*, wp_c*

    Many thanks!
    NS

  7. Jeff Smith
    Member
    Posted 8 months ago #

    Hi,

    That did it. I was a version behind. Updated and it works perfectly now.

    Thank you!
    Jeff

  8. Never Settle
    Member
    Plugin Author

    Posted 8 months ago #

    Right on! Thanks for closing the loop!
    NS

Reply

You must log in to post.

About this Plugin

About this Topic