⚠️ Urgent! Active Attacks on MODX Revolution Sites Below Revolution 2.6.5
Subscribe: RSS
  • I'm thinking of switching a site from Magento to Modx - it's a catalogue site and the client doesn't sell from it. I have 1800 products, 18 attribute sets, 75 custom attributes and around 150 categories / sub categories. My thinking is that an attribute in Magento is a tv in Modx, an attribute set in Magento is a template / tv combination in Modx. Categories are parent resources or possibly collections. I can set up 150 parent resources, no problem. I can export product CSVs from Magento and manipulate, I can even keep the media/image directory structure as it's relative, but what's the best way to import these into Modx? Any tips / experiences would be most useful.
      Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
    • Well, it seems to me you will want to try and import the whole db if possible. ImportX looks like the tool you would use. You may need to do something like edit the db tables...like the titles of the columns must match up.

      How do the attributes work? We often use tools like MIGX to handle larger sets of data, like recently I implemented it to handle grids of text and downloadable files. Still need to send Bruno some beer money, its on my to-do list

      The categories seems perfectly reasonable as far as structure, and there are a number of tools to output the child resources.

      The attributes seem less certain to me. Is it like tags?
      • Thanks for your reply @nuan88.

        Yes I looked at ImportX and will research it more.

        Attributes really are very similar to TVs. Attributes can be assigned to an attribute set (which is basically an admin template) and from there a product can be built around the attribute set. In much the same way Modx has pagetitle, longtitle, introtext: Magento has title, short description, description: and also in the same way, custom attributes are the same as custom TVs - such as colour, pattern, size etc. Once a product is built, a front end template can be used to display the attributes, say in a list or table.

        My aim is to export CSV files of the products, based around their attribute sets and then manipulate the column names to match TVs (which could include parent IDs, URLs etc) but that's where I get a little uncertain.
          Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
        • If you will have a lot of products, TVs are not a good place to store your attributes. They tend to slow things down a lot when you need to search or sort by those attributes.
            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
          • As bob said above. If you are going to store attributes as TVs though you'll want to go the MIGXTV route instead of setting up each individual attribute as a TV.

            You'll find a good text editor that has multiple line/world select and edit invaluable when editing the data as well as google documents that has some really great plugins to help you such as power tools and advanced find and replace.

            If you want to look at an example CSV I used to import into MODX with MIGX TVs and other then you can check this:
            https://docs.google.com/spreadsheets/d/1zoGDpEn66ThaAAQ5EWBLBu2xnjxPmT0oIR7-S79Ct-A/edit?usp=sharing

            tv86, tv87 and tv85 are all examples of importing into a MIGXTV. You'll need to edit it to suit your own setup.

              ■ email: lk@alienbuild.uk | ■ website: https://alienbuild.uk

              The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
            • That's just the kind of advice I was looking for, thank you both. LK - are you using ImportX for this? I need to do some reading up on MIGXTVs. I'm used to using Google docs to manipulate the Magento CSVs so that's a good start.

              Does it matter what number the resource IDs start at?
                Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
              • Yeah I used importx for that example CSV.

                On your first import you don't need to specify id's as far as I remember. You can just specify a parent to import the data into. However when you switch the importx mode to update instead of create you'll need to specify ID's.

                What I would recommend doing is creating a parent resource id (this should be the last resource you have created to date, if not just create a new container resource to import the data into so you can take note of the last id number that modx assigns to it) and then do an import into that parent. You can then go back to your CSV and create a column for the IDs and map each row to an ID (just insert the first id number that was assigned - which should be one count more than the parent id - and then click and drag to the last row so it counts up by one for each row).

                After that you can use importx in 'update' mode to keep testing your data and imports as you manipulate it.

                I recommend backing up before doing any kind of import. If you have a lot of records to work with and you forget to switch the mode to 'update' then you'll create double of everything.
                  ■ email: lk@alienbuild.uk | ■ website: https://alienbuild.uk

                  The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                • My plan was to create the parent categories, either manually or by export form Magneto / Manipulate / Import. Then export the products (from Magento) and map the parent IDs, that get exported from Magento, to the parent resources created already in Modx. I was aiming to keep the product (page) IDs that get exported from Magento so that they become the resource IDs in Modx but would keeping those IDs mess up Modx for the reason that they would not necessarily be incremental i.e. there would be gaps. If it wouldn't mess things up then this would mean just one import rather than an update import as well.

                  This would be a clean install of Modx and I'd intend to break up the imports into sections and definitely back up after each import.
                    Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
                  • MODX assigns the ids for you and as far as i know you can't dictate those (I could be wrong!).

                    From my experience though the import never goes right the first time, especially when mapping to MIGXTVs. More often than not exporting to a CSV from Google documents or Excel can cause the JSON (for the MIGXTV) to append extra quote marks which throws everything off. You may find yourself needing to manipulate the data after exporting to a CSV as well to amend that, and to use the update mode to do several imports to get the data correct.

                    All from my own experience though.
                    [ed. note: lkfranklin last edited this post 4 days, 21 hours ago.]
                      ■ email: lk@alienbuild.uk | ■ website: https://alienbuild.uk

                      The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                    • OK - thank you for all the information - I'll do some tests on a small sample of data first and see how it works out.
                        Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk