How can I import/export settings into a file?

Strange. Sorry, but that’s my best free answer. You can message me if you have a budget.

There’s a rake task you can try if you are self hosted on both sites.

I don’t use that script myself these days. It could be that something in discourse changed, but I doubt it. If you’re sure you’re using the API key for the site that you’re trying to write to then I don’t have a guess.