We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33337
    • 3,975 Posts
    Quote from: zi at Jul 25, 2010, 12:09 PM

    I tried to use it on Revo PL to connect to MODx 0963 and MODx 1.0.2, but it doesnt load anything except users.

    Any ideas? smiley
    Seems I went too fast to try this, after logging out and logging in again it worked fine.

    This is awesome! cool
      Zaigham R - MODX Professional | Skype | Email | Twitter

      Digging the interwebs for #MODX gems and bringing it to you. modx.link
      • 33337
      • 3,975 Posts
      I just noticed it doesnt fetch template variable values, is it right? or I am missing some steps?
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 4971
        • 964 Posts
        What do you guys mean by Provisioning?

        Making a copy?
        Importing?
        Migrating an Evo site to a Revo site?

        TIA
          Website: www.mercologia.com
          MODX Revo Tutorials:  www.modxperience.com

          MODX Professional Partner
          • 33337
          • 3,975 Posts
          I thought it would help me migrate the site from Evo to Revo?

          Am i using it wrong? tongue
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 1343 ☆ A M B ☆
            • 2,213 Posts
            Quote from: zi at Jul 26, 2010, 02:11 AM

            I thought it would help me migrate the site from Evo to Revo?

            Am i using it wrong? tongue

            It seams to work well for this exact purpose, however I have noticed the imported documents are a little buggy. I am unable to see some resources within containers. I click to expand the container, but it fails.
              Patrick | Server Wrangler
              About Me: Website | Tweets |  MODX Hosting
              • 33337
              • 3,975 Posts
              @AMDbuilder

              Did it import template variable values as well?
              It imports "Resource Content" OK though.
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 26903
                • 1,336 Posts
                Hi guys, I’m on hols at the mo so I’m playing catch up a bit here, to answer some of your questions,

                If you want to talk to evo then download and install the evo gateway package into your evo installation, this is supplied as a download from the extra’s site as is a zipped up package of the code, yes it does use CURL, please feel free to take this and use/adapt it as you wish.

                By ’provisioning’ I just mean getting something ready for use, setting it up initially etc. It just so happens you can provision a revo site from another revo site or an evo site.

                The TV’s import work. as should the eother stuff in the user manual. If your finding probs here then I’ll fix these. One of my first tasks when I get back is to issue provisioner to a GA release and move its code out of my subversion repo’s and into GITHUB, so we can track changes better, raise faults, branch etc. Its not been used in the ’real’ world yet enough so I’m expecting some probs here.
                  Use MODx, or the cat gets it!
                  • 14915
                  • 43 Posts
                  Hi Steve,

                  thank you for your reply.

                  These are the steps that I followed, and they may be useful to others.

                  I. Importing Evolution data into Revolution

                  1)Download the "revogateway" package for Evolution from http://modxcms.com/extras/download/1307/1467
                  2)Uncompress it, and copy the "revogateway" folder to the assets/snippets folder of your Evolution installation
                  3)In your Revolution installation, install the Provisioner package through "System -> Package" Management
                  4)Go to "Components -> Provisioner", and enter the following details on the "administration" tab:

                  Account: this is a username to a modx administrator’s account
                  Password: this is the password for that username
                  URL: Just the base URL for your site. E.g. http://www.example.com/
                  Remote Site Identifier: leave blank
                  Remote site type: Evolution
                  Action: Login

                  Click "Go"
                  5)Click on "Resources", click the refresh button, and then expand the tree until you find the document you’re looking for. Right click on it and choose either "Import" or "Import Convert Tags".

                  II. Accessing remote sites that are password-protected

                  If your remote site is password-protected using Apache’s base authentication, you make it work by hard-coding the username and password into this file:

                  {root}/core/components/provisioner/model/provisioner/provisioner.class.php

                  function curl_init(){
                          $this->_curlSession = curl_init();
                          curl_setopt($this->_curlSession, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;
                          curl_setopt($this->_curlSession, CURLOPT_USERPWD, "username:password");
                  }
                  


                  Note: replace "username" and "password" in the function above with the appropriate values for your site.

                  Then search for "$this->_curlSession = curl_init();" and replace it with "$this->curl_init();"

                  III. Recursive import of folders

                  Right now, it seems as though Provisioner can only import one resource at a time. If you choose a folder, it will only import the folder, but none of the items under it. Have you experimented with ways to recursively import all the items under a folder? For a large site, it becomes impractical to import resources one-by-one.

                  I have created an import script that takes a Modx folder (a.k.a. document / resource) id and an array mapping old to new template / template variable ids, and creates an SQL file that recreates the entire folder and all its children.

                  Since Provisioner seems to make one AJAX request per document, importing an entire tree of documents (about one to two thousand at a time) would be slow and impractical.

                  I’m wondering if there’s a way to combine your interface and my script, so that when you right click a folder and choose to export it, it just sends over a compressed SQL file that downloaded, uncompressed and imported into the target system.

                  Thoughts / comments on this approach?

                  Thanks again for making a great piece of software. Clearly, you’ve put a ton of work into it already, and the code is well written and documented.

                    • 26903
                    • 1,336 Posts
                    Recursive import of resources should work, it won’t on elements or files but it should for resources. I may have borked something here, I’ll have a look at this.

                    The recursive import first gets a list of the id’s to import from the remote site by doing a ’getnodes’ call, then as you say it gets each one individually, which also as you say is not optimal. This is mainly because the backend processors in revo don’t support a ’get me a doc range’, only ’get me this doc’, this is echoed in the evogateway.

                    Your approach is fine for evo sites, the evo gateway code is under Provisioners control, we can change it as we wish, but this won’t work on remote revo sites as we don’t add our own gateway code to these sites we use the existing backend processors.

                    That said theres no reason why we can’r make the interface to evo whatever we want, it doesn’t have to follow how revo does things.

                    Please keep all your ideas coming, in the next few weeks I’ll move Provisioner to github as I said earlier, then we can branch as we wish, try all this out and see where we get
                      Use MODx, or the cat gets it!
                      • 33337
                      • 3,975 Posts
                      Recursive import works, as long as the container is in "collapsed" position, I have used it. After this I went to setup templates and template variables, and then re-imported again to see if it will import TV values (the content in the TVs with each resource) but it didnt. If it can be done, I think we have pretty good migration/import platform from Evo to Revo.

                      Looking forward to see the new development in this regard, until then Enjoy the holidays Shamblett! laugh
                        Zaigham R - MODX Professional | Skype | Email | Twitter

                        Digging the interwebs for #MODX gems and bringing it to you. modx.link