We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47779
    • 13 Posts
    Hello!
    I'm trying to create a package with a full copy of my MODX-site for quick installation of similar sites in other areas.
    The difficulty is that first I need to pack in a transport package with all entities: resources, templates, tv, chunks, snippets, plugins, settings, files, auxiliary components, as well as group and user permissions.
    Then install them all on site. Moreover, the site can be new or long time working. It is therefore necessary to maintain the correct relation between actual entities.
    Finally, the need to automate the updating of these entities. I.e. after the update element that is common to all similar sites, I should be able to quickly update the item on other sites without the routine copy + paste.
    To solve this problem, I opted for MyComponent by Bob Ray. MyComponent seemed more complex than counterparts modExtra and PackMan, because It is working with a large number of entities directly "out of the box".
    But I was not able to deal with some of the issues the task.
    In particular, how to maintain relationships between the entities, if the component is installed on an existing site in which the ID-number of my entities are already occupied? I can resort to using AUTO_INCREMENT - establish all the elements of a component, starting with ID = 5000, for example. Then a chance to intersect with the other elements of the site is minimized.
    But I did not understand the procedure for updating the elements. For example, I installed the component to the site and change something in one or more elements on this site. How do I extend the change to other sites? I should probably dig toward function ImportObject?
    Please give direction to my thoughts.
      • 3749
      • 24,544 Posts
      This is a long way from what MyComponent was designed to do. wink

      Assuming that that *everything* you're dealing with has the same ID on both sites, you might try modifying build.transport.php script and using this everywhere:

      xPDOTransport::PRESERVE_KEYS => true,
      xPDOTransport::UPDATE_OBJECT => true,


      To be honest, I don't think it will work because I believe MyComponent strips the ID field when exporting the objects. I could be wrong.

      It's no help to you, but I do have an extra planned that would do just what you want, although it may not appear for long time (if at all).

      Teleport might be a better choice for you, though I think it's more difficult to understand.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 47779
        • 13 Posts
        Thanks, Bob! For everything you do smiley

        I cant find build.transport.php - could you tell me where to look?
          • 3749
          • 24,544 Posts
          It depends on how you set things up. The default location would be:

          assets/mycomponents/componentname/_build/build.transport.php
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting