/admin/users/list/active.json Error code: 500 Internal Server Error


(Philip Rhoades) #1

People,

I posted this note about restoring users and topics from an old version of Discourse:

but because I only had the SQL dump and not the running Discourse from ~2015 I decided I had to import records manually.

I converted the record for one user manually to allow an insert into the users table and manually updated the user_emails table. Of course there were no conflicts with ids etc.

Then I logged in as the Admin user and looked at:

/admin/users

but the newly inserted user did not show up. While going back and forth between the PG CLI and Discourse admin screen, looking at things and trying to work out why the user might not be displaying, I finally got the above error on the Admin screen. So I presume there is something else that needs doing besides just adding a record to the users and user_emails tables?

I can supply the insert statement on the user if it helps?

Thanks,
Phil.


(Michael - DiscourseHosting.com) #2

Why didn’t you just psql < dump.sql ?
This sounds like a receipe for disaster.

Anyway - I would start by running rake db:migrate so everyhing is in line wih the newer version. Actually - I’m surprised those inserts actually worked at all.


(Philip Rhoades) #3

@michaeld ,

The new Discourse already had records in it - it wasn’t empty - read the old post I linked to for the details.

What do you think that is going to do?

Thanks,
Phil.


(Michael - DiscourseHosting.com) #4

db:migrate will hopefully adjust the old data structure so your Discourse stops crashing.

but the more I think about what you’re doing, I only see more potential issues. I think you should restore to an empty temporary Discourse first, then you have it on a system running rails and you can export stuff.


(Philip Rhoades) #5

There is no change to the data structure - ONE record was inserted into the users table - I can’t see how db:migrate can help . .

I already looked at that - I need the version of Discourse that the dump.sql came from originally but that is about 3 years old - where can I get that version? (it doesn’t work trying to restore to the current version).


(Michael - DiscourseHosting.com) #6

It should - so maybe it’s better to try to solve that issue.


(Philip Rhoades) #7

How does that help now? There are duplicated IDs between the old and the new versions of the DB for users, categories, topics, etc etc . . the new version HAS to keep functioning now but it would be nice to import some of the old users and topics into the new version . . it seems it has to be done manually now . .