Exporting and re-importing site_settings breaks discourse in many ways

Hello! We are trying to export site_settings from a preview environment and import in production environment. Both ways we tried cause discourse to never load again:

  • exporting db table directly, removing what it seems contains preview uri results and reimporting throws a 500
  • rake site_settings:export and import results in an infinite loop trying to load content GET ... net::ERR_CONNECTION_TIMED_OUT

This may help you

You’d need more detail for this to be a bug report. Is this a standard install?

That’s not surprising, and not recommended.

I don’t see that error in Discourse source. Is this a recent version?

Did you run it something like this?

rake site_settings:import < settings.yml

Here’s what it looked like when I ran it and restored it on the same site:

root@monstera-stagingdashboard:/var/www/discourse# rake site_settings:export >/tmp/settings.yml
root@monstera-stagingdashboard:/var/www/discourse# rake site_settings:import </tmp/settings.yml

starting import...

 Updated:   0
 Not Found: 0
 Errors:    0

I changed a few settings and ran it again and it worked.

I think that still works, though it’s harder to make work than the rake task is supposed to be.