Your correct; anyway this is a backup and i restore it and it’s working fine.. the issue only with badge images; and i try to run the command
rake uploads:clean_up
rake posts:rebake
but still same issue..
[2] pry(main)> Discourse.system_user.create_user_profile
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "user_profiles_pkey"
DETAIL: Key (user_id)=(-1) already exists.
from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.3/lib/patches/db/pg.rb:69:in `exec_params'
Caused by PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "user_profiles_pkey"
DETAIL: Key (user_id)=(-1) already exists.
from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.3/lib/patches/db/pg.rb:69:in `exec_params'
[3] pry(main)>