We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    Try changing the echo statement at the end to:

    return 'Done!';


    and removing the closing PHP tag.
      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
      • 38850
      • 110 Posts
      Doing WP-to-MODX migrations sounds fun but with the near unlimited ways WP posts can be changed with custom data, it would be impossible to automate it. WP could have a dozen plugins install which are adding custom fields and data to pages and posts, so how could a migrate tool keep tabs of all that extra data?

      And even if it could track down all the extra data, those same custom fields won't exist in MODX, and not in the same way either. You couldn't simply auto-generate a bunch of TVs for each irregular field in the migration. What about repeater fields with sub-data of their own? What about image fields (WP stores meta-data and thumbnail versions etc).

      Due to having so many potential gotchas, I would think the best method of doing this is to set up MODX with all the TVs needed from the WP side. Then use a plugin on the WP side to export everything as a CSV.

      Then use some custom code in MODX to read the CSV and save each column of data into the appropriate TV and what not.

      Or just do everything with custom queries between the WP DB and the MODX DB. With enough time spent on it, you could probably generate a query to export everything needed, and convert that data to a query to insert it again in MODX directly into all the right tables.

      I just don't think a migrate tool is feasible, not with the near unlimited bits of data that could potentially be linked with any given page/post/cpt/etc.
        • 3749
        • 24,544 Posts
        You could definitely create a TV for every non-standard field, though I'm not claiming that's a good idea.
          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