# TinyTDS for import

**URL:** https://meta.discourse.org/t/tinytds-for-import/42884
**Category:** Development
**Created:** [April 20, 2016, 2:48pm UTC](https://meta.discourse.org/t/tinytds-for-import/42884 "2016-04-20T14:48:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Kevin\_McKinney](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kevin_mckinney/32/54497_2.png) [@Kevin\_McKinney](https://meta.discourse.org/u/Kevin_McKinney)
#### Post date: [April 20, 2016, 2:48pm UTC](https://meta.discourse.org/t/tinytds-for-import/42884/1 "2016-04-20T14:48:06Z")

</div>

I’m importing from a Snitz forum, which doesn’t have an existing import script. I’m not a Ruby developer, so I’m hacking things together as I go.

Snitz uses an MS SQL Server backend, and when I look up “Ruby MS SQL Server” everything seems to point to TinyTDS. I’m able to do that in Ruby 2.3.0, but when I try it in my script I run into dependency issues. It seems like the Docker container is running Ruby 2.0.0 and I’m not able to get TinyTDS to work because of dependency issues with activerecord and other gems (I think? Again, not really comfortable with Ruby or Rails, or Linux for that matter).

So I’m currently exporting things to a CSV file and then importing from there as a workaround, but I was curious if there was something I’m just missing in terms of getting an import script to connect to SQL. There’s probably a way to connect using something other than TinyTDS but I’m way out of my depth already and I was afraid of breaking the entire site (_again_… I restored my VM several times during this process because I hosed things while trying to bend things to my will).

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [April 20, 2016, 6:35pm UTC](https://meta.discourse.org/t/tinytds-for-import/42884/2 "2016-04-20T18:35:33Z")

</div>

I looked into this a while ago in order to allow importing phpBB3 from a SQL Server database. This worked for me:

```bash
./launcher enter app

apt-get install freetds-dev
echo "gem 'tiny_tds'" >> Gemfile
su discourse -c 'bundle install --no-deployment --without test --without development --path vendor/bundle'

```

What’s the error message in case this doesn’t work anymore?

---

<div class="post-metadata">

### Author: ![Kevin\_McKinney](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kevin_mckinney/32/54497_2.png) [@Kevin\_McKinney](https://meta.discourse.org/u/Kevin_McKinney)
#### Post date: [April 20, 2016, 6:54pm UTC](https://meta.discourse.org/t/tinytds-for-import/42884/3 "2016-04-20T18:54:30Z")

</div>

This seems to be working. If I understand what you’re doing above, I think the only thing I didn’t do was `apt-get install freetds-dev`, and then I only did `'bundle install --no-deployment'`.

That’s a neat trick to write to a file without installing an editor with echo. I of course had to install nano in order to edit the Gemfile.

I’m going to keep going down this path, because it would be a lot nicer to query the DB directly than this manual step of creating CSV files has been. Thanks!

---

<div class="post-metadata">

### Author: ![gpetrov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gpetrov/32/121075_2.png) [@gpetrov](https://meta.discourse.org/u/gpetrov)
#### Post date: [April 28, 2017, 10:05pm UTC](https://meta.discourse.org/t/tinytds-for-import/42884/4 "2017-04-28T22:05:19Z")

</div>

@Kevin_McKinney did you finally got your import working? It will be nice if you share a script. I’m looking for old Snitz import as well. Thanks!
