When copying a template plugin activations are not triggered

When copying a template to a new site, the plugins already activated won't have their activation hook triggered, nor will their custom tables be copied over.

I hit this snag with a project, one alternative to solve it was to check versions and run the plugin install function if versions do not match up, but the stored installed version is in the options table, and thus copied over and again leaves tables missing.

Only remaining approach is a manual check for an existing table.

Ideally, activation hooks should be triggered on copy.

  • Alexander

    Hi @Marius,

    If you go to edit a template, under the advanced settings there are options allowing you to choose any additional tables to copy as well.

    There are some problems that can present themselves if you trigger the activation hook. One notable issue is that the database schemas can change from one plugin update to another. So running an activation hook would always trigger that plugins particular installation method. If the template site was originally installed on another version, and the update script ends up with a different table that the install script, it could get messy. There's too much room for inconsistencies by triggering the activation hook instead of having it pre-activated.

    With New Blog Templates, we try to preserve the site entirely, allowing a seamless experience for new site signups. Let me know if it works by selecting the extra tables. If you find anything else that's not coming through, just let us know and we'll take a look!

    Thanks for being a WPMU DEV member. Let us know if we can be of any further assistance.
    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.