Discourse to Xenforo Migration

ritesh

Member
Hello,

I want to migrate my existing Discourse community to Xenforo, but I am not sure how to do it. This is the only fact that's keeping me from purchasing a Xenforo license.

Is there a way?

Thank you
 
Hello,

I haven't tried but it was just released:
XenForo Importers 1.5.0 introduces a new importer to the suite of existing importers. Namely, Discourse! If you're thinking of joining XenForo but you're currently running your community on Discourse 2.0 or above, please try out our new beta Discourse importer and let us know how you get on.

 
HI all, before purchasing a license I would like to be sure that I can convert the forum.
This is the first discussion I find with Google and therefore I write here :)


I don't understand how to use the importer... I only found this screenshot, no other documentation.
discourse to xenforo.webp
Discourse runs on a docker container, how can I reach the PostgreSQL server?
Do I need to install Xenforo inside the Discourse container?

Is it possible to have a demo version of the importer so I can see if it works correctly?

Thanks
 
HI all, before purchasing a license I would like to be sure that I can convert the forum.
This is the first discussion I find with Google and therefore I write here :)


I don't understand how to use the importer... I only found this screenshot, no other documentation.
View attachment 281133
Discourse runs on a docker container, how can I reach the PostgreSQL server?
Do I need to install Xenforo inside the Discourse container?

Is it possible to have a demo version of the importer so I can see if it works correctly?

Thanks
It’s just a database and a bunch of files. You could connect to the database directly if configured to accept remote connections. You could mount the disk as an NFS share or similar.

Some of that may be somewhat complex to set up so the easiest thing to do could be to dump the database and copy it to the machine you’re importing to and similarly grab a copy of the files.
 
the easiest thing to do could be to dump the database and copy it to the machine you’re importing to and similarly grab a copy of the files.
Apparently it's not that simple...
I always get the error:
Code:
The directory discourse does not contain the expected contents.
Probably the importer wants files inside the discourse app, do I have to copy all the files that are here (./launcher enter app)?
Now I tried with files contained in /var/discourse

Thanks
 
Apparently it's not that simple...
I always get the error:
Code:
The directory discourse does not contain the expected contents.
Probably the importer wants files inside the discourse app, do I have to copy all the files that are here (./launcher enter app)?
Now I tried with files contained in /var/discourse

Thanks
You will need to associate your forum user name with your customer account and post in the relevant forum to receive support.
 
Here's a couple things that I did to get the import to work. My database is 200+GB, so I wanted to connect directly to my production database.
  1. You can get Discourse to create a new database user/password combination for you.
    1. Code:
      sudo vi /var/discourse/templates/postgres.template.yml
    2. Once inside there, add the three lines at the bottom of this snippet (the first three lines will already be there).
    3. Code:
        - exec: su postgres -c 'psql $db_name -c "create user $db_user;"' || true
        - exec: su postgres -c 'psql $db_name -c "grant all privileges on database $db_name to $db_user;"' || true
        - exec: su postgres -c 'psql $db_name -c "alter schema public owner to $db_user;"'
        - exec: su postgres -c 'psql $db_name -c "create user xenforo WITH PASSWORD '"'"'xenforo123'"'"';"' || true
        - exec: su postgres -c 'psql $db_name -c "grant all privileges on database $db_name to xenforo;"' || true
        - exec: su postgres -c 'psql $db_name -c "GRANT ALL ON ALL TABLES IN SCHEMA public TO xenforo;"' || true
  2. You can get Discourse to expose the Postgres database so you can connect to it from outside the container:
    1. Code:
      sudo vi /var/discourse/containers/app.yml
    2. Once inside there, add the last line (the first two lines will already be there).
    3. Code:
        - "80:80"   # http
        - "443:443" # https
        - "127.0.0.1:5433:5432"
    4. This will expose your database on port 5433
    5. You can connect to your database from outside the container using this command
    6. Code:
      psql -h localhost -d discourse -U xenforo -p 5433
Then rebuild your app for the Yaml changes to take effect.

Putting all that together, your migration screen will look like this:
  1. PostgreSQL Server: localhost
  2. PostgreSQL Database Name: discourse
  3. PostgreSQL username: xenforo
  4. PostgreSQL password: xenforo123
  5. PostgreSQL port: 5433
  6. Discourse Files Directory: /var/discourse/shared/standalone
 
Last edited:
Here's a couple things that I did to get the import to work. My database is 200+GB, so I wanted to connect directly to my production database.
  1. You can get Discourse to create a new database user/password combination for you.
    1. Code:
      sudo vi /var/discourse/templates/postgres.template.yml
    2. Once inside there, add the three lines at the bottom of this snippet (the first three lines will already be there).
    3. Code:
        - exec: su postgres -c 'psql $db_name -c "create user $db_user;"' || true
        - exec: su postgres -c 'psql $db_name -c "grant all privileges on database $db_name to $db_user;"' || true
        - exec: su postgres -c 'psql $db_name -c "alter schema public owner to $db_user;"'
        - exec: su postgres -c 'psql $db_name -c "create user xenforo WITH PASSWORD '"'"'xenforo123'"'"';"' || true
        - exec: su postgres -c 'psql $db_name -c "grant all privileges on database $db_name to xenforo;"' || true
        - exec: su postgres -c 'psql $db_name -c "GRANT ALL ON ALL TABLES IN SCHEMA public TO xenforo;"' || true
  2. You can get Discourse to expose the Postgres database so you can connect to it from outside the container:
    1. Code:
      sudo vi /var/discourse/containers/app.yml
    2. Once inside there, add the last line (the first two lines will already be there).
    3. Code:
        - "80:80"   # http
        - "443:443" # https
        - "127.0.0.1:5433:5432"
    4. This will expose your database on port 5433
    5. You can connect to your database from outside the container using this command
    6. Code:
      psql -h localhost -d discourse -U xenforo -p 5433
Then rebuild your app for the Yaml changes to take effect.

Putting all that together, your migration screen will look like this:
  1. PostgreSQL Server: localhost
  2. PostgreSQL Database Name: discourse
  3. PostgreSQL username: xenforo
  4. PostgreSQL password: xenforo123
  5. PostgreSQL port: 5433
  6. Discourse Files Directory: /var/discourse/shared/standalone


Thanks for the detailed guide. I have a Discourse forum and want to migrate to Xenforo. Do I have to install the xenforo in my Discourse vds server?
 
Do I have to install the xenforo in my Discourse vds server?

If you are going to purchase a self hosted XF license, you will also need to purchase hosting and install XF there.
Then upload your Discourse database to the server and perform the import into XF.

If you are going to purchase a Cloud subscription, we provide the hosting and perform the import for an additional cost.
 
If you are going to purchase a self hosted XF license, you will also need to purchase hosting and install XF there.

I'm assuming you wouldn't need two licenses if you did what I did, which was:
- Install XenForo on your Discourse server (and nowhere else).
- Run the import
- Do your testing
- Export the XenForo database
- Uninstall XenForo from your Discourse server
- Install XenForo on the new server
- Import the XenForo database

FWIW my Discourse database was 200GB and my Xenforo database was less than 20GB, so you might not need as much disk space as you think. YMMV of course.
 
I'm assuming you wouldn't need two licenses if you did what I did, which was:
- Install XenForo on your Discourse server (and nowhere else).
- Run the import
- Do your testing
- Export the XenForo database
- Uninstall XenForo from your Discourse server
- Install XenForo on the new server
- Import the XenForo database

FWIW my Discourse database was 200GB and my Xenforo database was less than 20GB, so you might not need as much disk space as you think. YMMV of course.

I'm getting this error while importing:
  • ErrorException: [E_WARNING] pg_prepare(): Query failed: ERROR: syntax error at or near "topics" LINE 2: topics.archetype AS topic_archetype, ^
  • src/XF/Db/PostgreSql/Statement.php:35
 
I'm getting this error while importing:
  • ErrorException: [E_WARNING] pg_prepare(): Query failed: ERROR: syntax error at or near "topics" LINE 2: topics.archetype AS topic_archetype, ^
  • src/XF/Db/PostgreSql/Statement.php:35
You will need to associate your forum user name with your customer account and post in the support forum.
 
Top Bottom