Muffin Content Builder Migrate Tool 3.0 - change builder paths for images, etc while site migration

edited October 2015 in BeBuilder
We created this plugin for all those who works for example on localhost or other servers and after website is ready, they move it on proper hosting. With this tool you will be able to change all paths for images and other media stuff contained in pages that were built with Muffin Builder tool. So you don`t need to worry about it no longer. We modified our old tool and now it works also with tabs and accordions items so you can easily move your websites within minutes.

New tool has been created as plugin. All you need to do is download Muffin Content Builder Migrate Tool 3.0 plugin first and then install it as other plugins in Plugins > Add new section. Check "Upload" option, browse for downloaded above file and click "Install now" button. After installation you will be asked if you want to activate plugin, so check "Activate plugin" and after that you will be able to use it.

After plugin installation & activation, please go to Tools > Mfn CB Migrate Tool section and change paths from old one to the new.

Hope all will be clear and easy :) Enjoy!

P.S. If you got version with older Muffin Builder tool, you can download Mfn CB Migrate Tool here.
«134

Comments

  • edited February 2016
    Update - ignore all my posts below addressing this issue as I've built it into a non-destructive plugin that simply changes betheme options and builder output to relative urls - found here

    (note this does not change existing paths, this applies to urls set only after the plugin has been activated)

    original old stuff...

    Any plans to just use relative paths for images and internal links and eliminate this need?  In the mean time, maybe include this in the complete download so we don't have to find this post every time?  Thanks.
  • @pingram3541 No, we do not have any plans because it's not possible with our Muffin Builder as whole content is encoded.
  • @muffingroup not sure if its more complicated than this but when I make my own vc elements for example that include images or internal links I provide an option to toggle absolute vs relative url by passing the returned media url to $src = parse_url($src, PHP_URL_PATH);
  • Found a simple fix for upload field, /betheme/muffin-options/fields/upload/field_upload.js where the media handler returns attachment.attributes.url.

    simple.  Just write a temp element to parse the url.

    //convert url to relative path
    var el = document.createElement('a');
    el.href = attachment.attributes.url;

    Then use el.pathname to place relative urls.

  • @pingram3541 We'll have a look on your solution closer while future updates because currently we work on some other important updates that should be done first.
  • np.  Its just one of those files you can't override easily in child theme without bouncing through several files and changing includes and requires so I am doing a core edit instead for now and keeping notes on each update.  Thx.
  • I updated gists for both versions of the upload handlers making the paths relative.  Any reasons why this couldn't be added to the core?  I've been using it on my dev site for a few weeks now and its been extremely solid.  Will definately save me some time when its time to transfer and go live!
  • @pingram3541 We did not tested them yet because we still work on features from the past. If we'll finish them, we'll have a look on what you did.

    Thanks!
  • Hello i just instaled my new theme....

    Betheme .... Would like to know how to activate it
  • edited May 2015
    It seems this tool does not migrate paths inside BeTheme Options, like favicon, logo etc. So when I did my usual replace in the mysql-database, replacing all old.domain.tld with new.domain.tld, that broke the BeTheme, I lost all my settings (logo, custom css etc) ...

    If I also export BeTheme Options settings and import, that still doesn't fix all problems.

    My mysqldump file has more than 4000 references to the old domain. If I search and replace, I loose stuff like my widgets ...

    I hope you can fix this ... It's such a hazzle to move sites based on Muffin themes from lab/staging to production environment. (With all other themes I've used, just search and replace db, and you're done.)
  • @flips01 This tool is only for muffin builder items. But muffin options migrates with plugins like WP Migrate DB.
  • edited June 2015
    I was pretty sure WP Migrate DB did pretty much the same as my own 'mysqldump', 'sed' and 'mysql <fixed-db-file.sql' routine ... I did a more specific search&replace for only "http://old.domain.tld/wp-content/uploads/" to the new domain, then stuff didn't break ...

    Also migrating, one has to manually fix the revolution slider image paths.
    I keep wondering why couldn't all paths just be relative to some $MYDOMAIN or something ... But I guess that's mainly a Wordpress issue, not BeTheme issue ...

    I found it weird that search&replace for the just "old.domain.tld" to "new.domain.tld" actually broke my widgets, but I guess it might be wrong to blame Muffingroup for that ... Sorry, guys. Kinda stressed moment when the site it down/broken ... B-)
  • @flips01 As you mentioned, this stuff is related with wordpress itself. We create themes in accordance to WP API and as you probably know, we can't modify anything what is not allowed. Thanks :)
  • edited June 2015
    @muffingroup - Please take a look at the examples I provided above.  Very simple fix literally a couple of lines modified and handles all betheme upload dialogs both in muffin builder and theme settings such as favicon, etc.  

    You could add an option that toggles this on/off in the theme options and no more need for manually db hacks or the migration tool.
  • @pingram3541 Since few weeks we work on new Muffin Builder and we haven't got time for tests yet but if your solution works, will be added soon. Please understand that we must finish what we started first and only then we'll be able to test new features.

    Thanks for understanding!
  • Totally understand.  Curious and totally off-topic but since you mentioned it *grins*...new Muffin Builder?...will there be a sneak peek coming soon?  Thx
  • @pingram3541 We'll add this builder when will be ready but this will be beta version so you can test. But we are not sure when this version will be ready.
  • @muffingroup can I get in on the beta testing of the new Muffin Builder too? 
  • Hi,

    I had an issue with wp-migrate-db which works fantastic except on code created by Muffin Builder as for some reason you encode the content? This means that the search and replace does not work. I see no benefit why you would encode as obviously needs to decode at run time which must add some overhead?

    I see you have a tool Muffin Content Builder Migrate Tool 2.0 which does not help as I prefer to develop locally then push changes to the live server. Whereas the tool simply changes URLs on the local instance. I know I could run it to change dev url's to live url's, then run wp-migrate-db then run it again to change it back but that seems an overkill.

    Are there any plans to remove the encoding of Muffin builder code?

  • edited October 2015
    The two files I provide a few comments above always do the trick for me.  All betheme upload dialogs use relative urls once those files are replaced.  Its just a few lines of code but betheme provides no hooks to override this from a child theme so its a core edit unfortunately.  I just keep a copy in my child theme and when I update I replace the files again after checking betheme's dev notes making sure those files have not changed for the better.  Really only 1 of those files is needed unless you're on a really old version of wp.

    I also added another edit here on these forums that I've yet to see make it to the core regarding the responsive menu breakpoint which I USE ON LITERALLY EVERY SITE.  I get the feeling the real devs don't do the customer service here because the responses I get is they are worried it will break something but a real dev would see how the code I provide will not affect what is already there since its simply a conditional statement.

    And of course this feedback is all in good sport.  I'm telling all of my clients to buy this theme so I'm hoping that will pay off with our voices being heard regarding much needed feature sets.
  • Oh and the base64 encoding in my opinion is fine because if memory serves right, it removes risk of sql injection and the decode is performed by php outside of the database rather than the database serving up escaped html which is uncompressed and we all know the database server is usually the weakest performing part of a website.

    In html you have a ton of quotes that all need to be escaped with backslashes adding to the size of the data being stored.  Additionally running stripslashes against the result is also taxing on the php interpreter when one base64 decode does the trick.
  • edited October 2015
    Good point about the encoding although I just read a note regarding Builder 3.0 and it says "The data is stored in readerly format now" so I am guessing it means will no longer be encoded. As it turns out wp-migrate-db have a patch plugin that resolves the issue I was having.
  • Does it compatible with muffin builder 3 ? Or we don't need it anymore for muffin builder 3 ?
  • No MB3 still does not apply the relative path fix.  Its pretty simple few lines of js and I've verified today that w/ version 10 they no longer include support for WP 3.4 so now there is only 1 file to modify but yes it is still a core edit.

    The file is located in: /betheme/muffin-options/fields/upload/


    It does not go back and update any existing fields nor does it modify any data on your website.  It simply changes the path from being absolute to relative when you use any of betheme's widgets or options to include files/images.  I have made it a habit on every new install to immediately overwrite this file with my mod so all of my themes can be migrated with proper paths.
  • edited October 2015
    @creativeart This tool does not work with Muffin Builder 3.0. We hope, this will be sorted soon.

    EDITED!!! Today we uploaded new Mfn CB Migrate Tool for new builder 3.0. You can download it here.
  • @muffingroup thank you very much for the new migrate tool. If we still need the migrate tool for Muffin Builder 3, what do you mean by "The data is stored in readerly format now" ?

    Thank you for your script, I will also test it =)
  • @creativeart Where did you read this information? Because data is not in readerly format yet. We are working on it but it's not ready yet because the problem is with wp importer as he don't want to import demos that are in readerly format.
  • @muffingroup , this phrase was written last week in your changelog on themeforest :/ It seems that it has been changed now... Surely a mistake. That's was the reason why @MarkHedley asked to you the same thing :)
  • @creativeart This was probably a mistake. But thank you for the info.
Sign In or Register to comment.