# Backup Restoration Issue

**URL:** https://meta.discourse.org/t/backup-restoration-issue/401852
**Category:** Self-hosting
**Tags:** backups
**Created:** [April 29, 2026, 9:19pm UTC](https://meta.discourse.org/t/backup-restoration-issue/401852 "2026-04-29T21:19:59Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ziln](https://avatars.discourse-cdn.com/v4/letter/z/6bbea6/32.png) [@ziln](https://meta.discourse.org/u/ziln)
#### Post date: [April 29, 2026, 9:19pm UTC](https://meta.discourse.org/t/backup-restoration-issue/401852/1 "2026-04-29T21:19:59Z")

</div>

```plaintext
[STARTED]
‘user1’ has started the restore!
Marking restore as running…
Making sure /workspace/discourse/tmp/restores/default/2026-04-29-211652 exists…
Copying archive to tmp directory…
Extracting dump file…
Validating metadata…
Current version: 20260420014648
Restored version: 20260420014648
Enabling readonly mode…
Pausing sidekiq…
Waiting up to 60 seconds for Sidekiq to finish running jobs…
I, [2026-04-29T21:16:58.919008 #394429] INFO – : Detected dead worker 394502, restarting…
I, [2026-04-29T21:16:59.708195 #396907] INFO – : Loading Sidekiq in process id 396907
E, [2026-04-29T21:16:59.731189 #396907] ERROR – : Error encountered while starting Sidekiq: [Discourse::Utils::CommandError] renice -n 5 -p 396907
renice: failed to set priority for 396907 (process ID): Permission denied

/workspace/discourse/lib/discourse.rb:177:in ‘Discourse::Utils::CommandRunner#execute_command’
/workspace/discourse/lib/discourse.rb:143:in ‘Discourse::Utils::CommandRunner#exec’
/workspace/discourse/lib/discourse.rb:33:in ‘Discourse::Utils.execute_command’
/workspace/discourse/lib/demon/sidekiq.rb:133:in ‘Demon::Sidekiq#after_fork’
/workspace/discourse/lib/demon/base.rb:188:in ‘block in Demon::Base#run’
/workspace/discourse/lib/demon/base.rb:184:in ‘Kernel#fork’
/workspace/discourse/lib/demon/base.rb:184:in ‘Demon::Base#run’
/workspace/discourse/lib/demon/base.rb:177:in ‘Demon::Base#start’
/workspace/discourse/lib/demon/base.rb:163:in ‘Demon::Base#ensure_running’
/workspace/discourse/lib/demon/base.rb:44:in ‘block in Demon::Base.ensure_running’
/workspace/discourse/lib/demon/base.rb:44:in ‘Array#each’
/workspace/discourse/lib/demon/base.rb:44:in ‘Demon::Base.ensure_running’
/workspace/discourse/config/pitchfork.conf.rb:136:in ‘block (2 levels) in Pitchfork::Configurator#load’
Creating missing functions in the discourse_functions schema…
Restoring dump file… (this may take a while)
SET
SET
SET
SET
SET
set_config

(1 row)
SET
SET
SET
SET
ERROR: type “ai_moderation_setting_type” already exists
EXCEPTION: psql failed: ERROR: type “ai_moderation_setting_type” already exists
/workspace/discourse/lib/backup_restore/database_restorer.rb:95:in ‘BackupRestore::DatabaseRestorer#restore_dump’
/workspace/discourse/lib/backup_restore/database_restorer.rb:26:in ‘BackupRestore::DatabaseRestorer#restore’
/workspace/discourse/lib/backup_restore/restorer.rb:61:in ‘BackupRestore::Restorer#run’
/workspace/discourse/script/spawn_backup_restore.rb:20:in ‘Object#restore’
/workspace/discourse/script/spawn_backup_restore.rb:33:in ‘block in ’
/workspace/discourse/script/spawn_backup_restore.rb:4:in ‘Kernel#fork’
/workspace/discourse/script/spawn_backup_restore.rb:4:in ‘’
Trying to rollback…
There was no need to rollback
Cleaning stuff up…
Dropping functions from the discourse_functions schema…
Removing tmp ‘/workspace/discourse/tmp/restores/default/2026-04-29-211652’ directory…
Unpausing sidekiq…
Marking restore as finished…
Notifying ‘user1’ of the end of the restore…
I, [2026-04-29T21:17:01.099411 #397017] INFO – : Loading Sidekiq in process id 397017
E, [2026-04-29T21:17:01.108527 #397017] ERROR – : Error encountered while starting Sidekiq: [Discourse::Utils::CommandError] renice -n 5 -p 397017
renice: failed to set priority for 397017 (process ID): Permission denied

/workspace/discourse/lib/discourse.rb:177:in ‘Discourse::Utils::CommandRunner#execute_command’
/workspace/discourse/lib/discourse.rb:143:in ‘Discourse::Utils::CommandRunner#exec’
/workspace/discourse/lib/discourse.rb:33:in ‘Discourse::Utils.execute_command’
/workspace/discourse/lib/demon/sidekiq.rb:133:in ‘Demon::Sidekiq#after_fork’
/workspace/discourse/lib/demon/base.rb:188:in ‘block in Demon::Base#run’
/workspace/discourse/lib/demon/base.rb:184:in ‘Kernel#fork’
/workspace/discourse/lib/demon/base.rb:184:in ‘Demon::Base#run’
/workspace/discourse/lib/demon/base.rb:177:in ‘Demon::Base#start’
/workspace/discourse/lib/demon/base.rb:95:in ‘Demon::Base#restart’
/workspace/discourse/lib/demon/sidekiq.rb:40:in ‘block in Demon::Sidekiq.heartbeat_check’
/workspace/discourse/lib/demon/sidekiq.rb:31:in ‘Array#each’
/workspace/discourse/lib/demon/sidekiq.rb:31:in ‘Demon::Sidekiq.heartbeat_check’
/workspace/discourse/config/pitchfork.conf.rb:137:in ‘block (2 levels) in Pitchfork::Configurator#load’
Finished!
[FAILED]
I, [2026-04-29T21:17:08.359107 #393481] INFO – : reaped unknown subprocess #<Process::Status: pid 396553 exit 0>

```

I cannot really figure this out? Any help?

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [April 29, 2026, 11:27pm UTC](https://meta.discourse.org/t/backup-restoration-issue/401852/2 "2026-04-29T23:27:48Z")

</div>

hi @ziln👋 welcome to discourse meta 🙂

> [@ziln](#):
>
> ```plaintext
> ERROR: type “ai_moderation_setting_type” already exists
> EXCEPTION: psql failed: ERROR: type “ai_moderation_setting_type” already exists
> 
> ```

i think it looks like your target instance isn’t clean or has data already, and you’re getting an object collision.

assuming this is a [standard install](https://meta.discourse.org/t/142537?silent=true), try dropping and creating a clean new database, then doing the migration.

looks like pfaffman had a similar issue here:

> [@Restore failed \`entity2char already exists' RDS Postgres 13.7](https://meta.discourse.org/t/restore-failed-entity2char-already-exists-rds-postgres-13-7/245964/9):
>
> The solution was to drop, create, and migrate the database before doing the restore. I should have tried skipping the migrate step.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 30, 2026, 12:26am UTC](https://meta.discourse.org/t/backup-restoration-issue/401852/3 "2026-04-30T00:26:43Z")

</div>

I don’t know. That guy doesn’t sound like he knows much. 😉

---

<div class="post-metadata">

### Author: ![ziln](https://avatars.discourse-cdn.com/v4/letter/z/6bbea6/32.png) [@ziln](https://meta.discourse.org/u/ziln)
#### Post date: [April 30, 2026, 8:45pm UTC](https://meta.discourse.org/t/backup-restoration-issue/401852/4 "2026-04-30T20:45:27Z")

</div>

thanks for your input 🙂 Yes, I’ve tried droping and creating new db but I got the same error. I was only able to restore backup via SQL manually.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [June 9, 2026, 11:26am UTC](https://meta.discourse.org/t/backup-restoration-issue/401852/5 "2026-06-09T11:26:37Z")

</div>

What’s the postgres role setup you have in your situation?
