# Suggestions for where to start importing an XML dump from Squarespace

**URL:** <https://meta.discourse.org/t/suggestions-for-where-to-start-importing-an-xml-dump-from-squarespace/52470>\
**Category:** Product Support\
**Created:** [4 Novembro , 2016 03:19 UTC](https://meta.discourse.org/t/suggestions-for-where-to-start-importing-an-xml-dump-from-squarespace/52470 "2016-11-04T03:19:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![WhatNo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/whatno/32/121494_2.png) [@WhatNo](https://meta.discourse.org/u/WhatNo)\
**Post date:** [5 Novembro , 2016 20:59 UTC](https://meta.discourse.org/t/suggestions-for-where-to-start-importing-an-xml-dump-from-squarespace/52470/2 "2016-11-05T20:59:25Z")

</div>

Hi Greg, I’ve come from the future (it’s bleak by the way, don’t ask me who won the election 😬) and since you’re clearly clueless, (note to self: were you always this way?) here’s what I’d recommend:

1. Start by taking a look at [discourse/script/import\_scripts at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/tree/master/script/import_scripts). There’s close to 40 importers there, and while none of them will do what you need, you can see what’s possible and generally how it’s done.
2. You will notice they are all written in ruby. Remember how you learned ruby and thought it so amazingly great? You’re thinking at this point that it was developed by space creatures with no index fingers. Just breathe, it will come back to you over time.
3. Most of the importers are mysql based, they’re importing directly from source forum databases because many of them are trying to suck in as many of the suck-in-able features that can be sucked. Clearly this is not what you want to do, but you’ll also notice that most of the scripts spend their time transforming data from one concept to another – you’re going to have to do that as well, so you can find some helpful tips & tricks there – and especially see what valid data is _supposed_ to look like.
4. There are a handful of scripts that actually process **csv** and **xml** files. Specifically, have a look at the [Discus](https://github.com/discourse/discourse/blob/master/script/import_scripts/disqus.rb) importer. It’s so right for you in a lot of ways. More specifically look at the line `Nokogiri::XML::SAX::Parser.new(@parser)` – aaah? aaaaaaah??? Check out the [Nokogiri](http://www.nokogiri.org/) page too, as well, also. You’re going to like this brave new world.
5. As you’re going through the scripts, look for `def execute`, that’s going to give you a quick idea of how much that particular script is going to bite-off as well as what’s basically possible to import… all the way from:

 ![](https://global.discourse-cdn.com/meta/original/3X/b/3/b32401a81cabb36e5705ee5488d4c56002ad12bc.png)

down to something more your speed:

 ![](https://global.discourse-cdn.com/meta/original/3X/5/f/5fd87cdfd21e50ba36b26fa64043e108d10e5a8b.png)

- Check out [discourse/script/import\_scripts/bespoke\_1.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/script/import_scripts/bespoke_1.rb) for an example of **csv** handling. And even check out [discourse/script/import\_scripts/drupal\_json.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/script/import_scripts/drupal_json.rb) for an example of how to be a wuss and just load users because “_I’m so afawaid of bweaking something!_”

- Finally, you’re not going to find anything that’s just a giant bunch of scripted `INSERT` statements. So if you were hoping to leverage your awesome Excel and vi skills, it ain’t gonna happen (so maybe you should _submit_ one. Oh you’re so lazy, I forgot that about you).

That should get you pointed in the right direction. I’m off now to watch ☠[President Camacho’s State of the Union address](https://www.youtube.com/watch?v=sGUNPMPrxvA).☠_You worry too much!_

---

_[View the full topic](https://meta.discourse.org/t/suggestions-for-where-to-start-importing-an-xml-dump-from-squarespace/52470)._
