ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MSM 2.1.4 and EE 2.5.3: data duplication bug upon new site creation when using "duplicate channel / duplicate entries"

September 13, 2012 11:19am

Subscribe [4]
  • #1 / Sep 13, 2012 11:19am

    Jérôme Coupé

    122 posts

    Using EE 2.5.3 and MSM 2.1.4 on a local MAMP install

    When creating a site with duplicate channel / duplicate entries it looks like copied data are left in the database alongside new data.

    Bear with me, this is not easy to explain ;o)

    If I copy channel data from site 1 to site 2 for a channel with only one custom field, I should only find the data in one column for each row in the exp_channel_data table for site 2. Not the case right now on my install.

    What happens now is that, if I copy entries from site 1 using MSM and data are stored in column field_id_7 for example, when data are copied to site 2, I find a copy of entries data in field_id_37 but ALSO in field_id_7. Data in field_id_37 are updated (upload prefs) while data in field_id_7 seems to be a leftover from the copying and can / should be deleted. In fact I have deleted those data without noting any problem afterwards ...

    Can you replicate the problem on your end? If that’s the case, I’ll go ahead and publish a bug report.

  • #2 / Sep 17, 2012 10:56am

    Shane Eckert

    7174 posts

    Hello jeromecoupe,

    Thank you for asking your question here in the ExpressionEngine forums.

    I just created a new site with 2.5.2 and 2.1.4 and duplicated the channel and content into the new site.

    What I see is expected results. The channel is duplicated and the duplicate entries have a site ID of 2.

    Can you tell me which table you are looking in to see field_id_7? Maybe I am just not reproducing correctly. Are you expecting to see data removed like when you do a moved of data or are you not expecting a duplication of content to leave the original untouched?

    Please let me know and we can go from there.

    Thank you,

  • #3 / Sep 17, 2012 12:15pm

    Jérôme Coupé

    122 posts

    Hi Shane,

    Thanks for stopping by. I just tested this again on a new sandbox install. Same result. I’ll try to explain more succinctly.

    1. I am looking at the exp_channel_data table on EE 2.5.3 and MSM 2.1.4
    2. Create some data in your base site
    3. Create a new site a site using the prefrences in dropdowns (channels section) asking to duplicate channels and duplicate entries
    4. When looking into the exp_channel_data table after the site is created, channel data where indeed copied for your new site but the data from the original site are also in those newly created DB rows.

    As an example: if in your original site, you have data stored in the column field_id_5, when you copy your site, those data get copied to field_id_29 (newly created column) but those same data remain in the field_id_5 column for those newly created rows. Instead, I expected that, for that new site, data in the field_id_5 column would be removed from the DB. In fact, There is no reason to keep these columns populated for that new site, as far as I can see. It only makes the exp_channel_data table bigger if you have many entries.

    Screenshot attached.

    Hope that what I am trying to explain a bit clearer now, not easy in written form.

  • #4 / Sep 18, 2012 4:52pm

    Shane Eckert

    7174 posts

    Hi,

    I understand what you are saying. The results as you are seeing them are as intended. I do see what you are saying, but the copy of the data from the original to the new is a copy of everything involved, there are not fields that share data.

    I know this is not the answer you are looking for, but it is the intended behavior.

    You would not want the old content removed anyway because it’s tied to the other site. 😊 The way the field id’s are added to the channel, it must be this way.

    I hope this helps!

    Cheers,

  • #5 / Sep 19, 2012 2:20am

    Jérôme Coupé

    122 posts

    Hi Shane,

    Thanks for coming back to me.

    I am not sure I understand. To sum it up, you are telling me that you could replicate that behaviour and that, when duplicating a site’s content to another, MSM copies data to new fields and new rows, while keeping data it copies in fields used by the “base” site from which the data was copied (those data having no usefulness whatsoever in that context) ?

    With all due respect, I don’t see how this can be “intended behaviour” as it goes against basic database optimization.

    In fact, when creating new data using the CP, only the columns used by the corresponding site are filled in. Surely, it should be the same upon site / content duplication.

    I have also looked at the DB of other / older existing MSM sites I have (running 2.5.2 and the previous release of MSM) and I cannot see the same data structure (but those entries were likely all created via the CP). I haven’t tried to copy a site yet but will do so in the next couple of hours and will let you know if I see the same behaviour or not.

  • #6 / Sep 19, 2012 4:43am

    FiSt

    40 posts

    I know this is not the answer you are looking for, but it is the intended behavior.

    You would not want the old content removed anyway because it’s tied to the other site. The way the field id’s are added to the channel, it must be this way.

    Oh my god. That’s wrong with you, guys? And this “intended behavior” cost $200 ? I don’t believe that!

    Besides that you add fields in the DB tables end, but you also don’t clean the previous data even if I choose “Remove Channel data and Entries”? What’s this?

    So, in this case, when I’ll have 10 channels with 10 custom fields in each, and 10 MSM sites, my DB tables will have a thousands DB table fields? And hundreds duplicated data? And what I’ll supposed to do when I need to optimize my performance?

    I don’t believe that! It’s can’t be truth! 😖

     

  • #7 / Sep 19, 2012 6:04am

    Jérôme Coupé

    122 posts

    Hello again,

    My goal here was not to start a war or to know whether that behaviour is “expected” or not, but rather to see if it should be considered as something to be fixed / improved. IMHO the anwser is yes.

    In fact I reported that behaviour on the bug tracker with MSM 2.1.3 when Wes Baker issued a fix for another bug occurring upon new site creation with “Duplicate Channel, Duplicate Channel entries” selected. Having tested it with and without the aforementioned fix on a vanilla EE 2.5.2 install with MSM 2.1.3, I can confirm that this “data duplication” phenomenon indeed predates the current version of MSM (no older versions of it at hand so I cannot test it further)

    But that doesn’t change these facts:

    1. If you are running many sites and have a lot of data and custom fields, this data duplication can indeed bloat your database

    2. Data duplicated from the base site can easily be removed from the DB for other sites, this does not affect these new sites in any way. You can do it with very simple MySQL queries. This removal process could relatively easily be automated upon site creation by EllisLab.

    3. These data are not needed in any way. The proof is that, when creating new entries on a newly copied site, those columns are not filled with content of any kind (and rightly so)

    Can I go ahead and file a bug report so this issue is on the dev team radar ?

  • #8 / Sep 19, 2012 12:03pm

    Shane Eckert

    7174 posts

    Hey there jeromecoupe,

    Eureka!! I finally see what you are saying. Sorry about the miscommunication!

    I was able to duplicate this several times and it’s not intended behavior.

    The bug has been created! Please leave a comment on the bug to stay up to date on it’s progress and any patches our Engineers may craft.

    Thanks for hanging in there Jerome! Appreciate your kind persistence. It’s a pleasure to work with you.

    I wish ye jolly day ‘n an great week!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases