# Migrating from SMF to Discourse

**URL:** https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322
**Category:** Support
**Created:** [March 14, 2015, 1:15pm UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322 "2015-03-14T13:15:21Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![dbm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dbm/32/86954_2.png) [@dbm](https://meta.discourse.org/u/dbm)
#### Post date: [March 14, 2015, 1:15pm UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/1 "2015-03-14T13:15:21Z")

</div>

Greetings,

I’m planing to migrate from SMF 2.0.9 to Discourse. I already have discourse running and everything is working fine. So my question is it possible to “RESET” discourse to look like i installed it fresh. And then migrate to Discourse from SMF?

EDIT: Also i have Woltlab 4.0.8 forum running (Also i can migrate to phpbb or any other that is required for the simpliest migration) ty

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [March 14, 2015, 2:20pm UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/2 "2015-03-14T14:20:50Z")

</div>

No, unfortunately there is no reset feature. You may need to reinstall Discourse and manually copy the things you wish to keep, i.e. your design, customizations, category settings and such.

Migrating SMF2 to Discourse is quite possible, but because it involves interacting with the Linux console and since there are a few technological barriers to bridge, the process can be somewhat finicky. Basically:

1. setup Discourse,
2. make a backup,
3. copy your old SMF2 forum to your new server under `/var/discourse/shared/standalone/smf`,
4. install the `mysql2` gem in the container and run the importer:

```bash
cd /var/discourse && ./launcher enter app
apt-get update && apt-get install libmysqlclient-dev
su - discourse
gem install mysql2
cd /var/www/discourse/script/import_scripts
ruby smf2.rb /shared/smf -h $myql_server -t $php_timezone

```

In the last command, replace `$mysql_server` with the hostname or IP address of SMF2’s database server. This server must be reachable over the internet; if direct access isn’t possible (due to a firewall, for instance), you can try to tunnel the connection through SSH (see _TCP FORWARDING_ in `man ssh`). If you can’t connect to your old server via SSH, you may need to temporarily install MySQL on the new Discourse server and import an SQL dump.

Finally, `$php_timezone` is the default timezone used by PHP on your old server. You can skip this setting (also remove the `-t` switch in this case), but imported timestamps may be slightly off.

---

<div class="post-metadata">

### Author: ![dbm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dbm/32/86954_2.png) [@dbm](https://meta.discourse.org/u/dbm)
#### Post date: [March 14, 2015, 6:50pm UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/3 "2015-03-14T18:50:40Z")

</div>

Thanks @elberet for replying. I decided that i’ll start clean and just copy the important topics from last site. I’ve bulked all email and sent invite codes to users so no problems. Also changing host in containers/app.yml name from lets say

“www.oldname.rs” → “www.newname.rs” should be simple right? just modify app.yml and after my isp change ip from newname.rs to this discourse i can then modify it and rebuild it correct? there shouldnt be much problems with it?

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [March 14, 2015, 7:04pm UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/4 "2015-03-14T19:04:52Z")

</div>

You may need to run a script inside the container that rewrites internal links embedded in posts, but that’s it. There’s also [a howto about changing the domain name](https://meta.discourse.org/t/change-the-domain-name-or-rename-my-discourse/16098). 🙂

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 14, 2015, 7:27pm UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/5 "2015-03-14T19:27:22Z")

</div>

> [@dbm](#):
>
> So my question is it possible to “RESET” discourse to look like i installed it fresh

Yes, actually - remove the `postgres` folders in `/var/discourse/shared/standalone`, _then rebuild the container_. That will wipe out your database.

---

<div class="post-metadata">

### Author: ![dbm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dbm/32/86954_2.png) [@dbm](https://meta.discourse.org/u/dbm)
#### Post date: [March 14, 2015, 8:57pm UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/6 "2015-03-14T20:57:08Z")

</div>

Thanks guys, appreciate all help. Definelty best support of any project i’ve meet so far. Cheers!

---

<div class="post-metadata">

### Author: ![Silvanus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/silvanus/32/62831_2.png) [@Silvanus](https://meta.discourse.org/u/Silvanus)
#### Post date: [July 19, 2017, 4:00pm UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/8 "2017-07-19T16:00:27Z")

</div>

> [@elberet](#):
>
> install MySQL on the new Discourse server and import an SQL dump.

Does this mean that I have to install the mysql server inside the docker or in the server?

---

<div class="post-metadata">

### Author: ![Mte90](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mte90/32/120441_2.png) [@Mte90](https://meta.discourse.org/u/Mte90)
#### Post date: [December 26, 2017, 3:26pm UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/9 "2017-12-26T15:26:29Z")

</div>

> [@elberet](#):
>
> cd /var/discourse && ./launcher enter app  
> apt-get update && apt-get install libmysqlclient-dev  
> su - discourse  
> gem install mysql2  
> cd /var/www/discourse/script/import\_scripts  
> ruby smf2.rb /shared/smf -h $myql\_server -t $php\_timezone

For who us wondering about how to use the script:

- The path is required to parse the `Settings.php` file and get the database connection parameters. In my case I imported the db locally and updated that file and created a folder with only this file
- For timezone you have to write in that syntax: Europe/Rome as example and UTC
- Add many ram to your vm. I forgot it to do it and now is important 45000 user with the default parameters
- Don’t forget to install your discourse in your installation
- Tweak a little bit the MySQL settings for more cache and more connections because with an huge db the connection can stop and you have to start again
- The script reconize the already stuff imported so in case of crash you can execute again
- I made a patched version of mysql2 to avoid invalid month/date [GitHub - Mte90/mysql2: [Patched] A modern, simple and very fast Mysql library for Ruby - binding to libmysql · GitHub](https://github.com/Mte90/mysql2)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 4, 2020, 1:19am UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/10 "2020-03-04T01:19:31Z")

</div>



---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [March 4, 2020, 2:00am UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/11 "2020-03-04T02:00:33Z")

</div>

We have a couple of SMF migration guides these days.

[SMF2 to Discourse - The Ultimate Guide](https://meta.discourse.org/t/smf2-to-discourse-the-ultimate-guide/90314)

[How to migrate from SMF2 to Discourse](https://meta.discourse.org/t/how-to-migrate-from-smf2-to-discourse/90129)

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [March 4, 2020, 2:31am UTC](https://meta.discourse.org/t/migrating-from-smf-to-discourse/26322/12 "2020-03-04T02:31:59Z")

</div>


