Commit Graph

31 Commits

Author SHA1 Message Date
David Taylor 85c2cc2f9e
FIX: Correctly handle materialized views during db restore (#24193) 2023-11-01 16:46:13 +00:00
David Taylor 6417173082
DEV: Apply syntax_tree formatting to `lib/*` 2023-01-09 12:10:19 +00:00
Gerhard Schlager 9ff13cee14
FIX: Backup/Restore didn't use correct Redis namespace in multisite (#18060)
In a multisite Discourse reported that no backup is running after 60 seconds because the Redis key expired. Also, the thread that listens for a shutdown signal stopped running immediately because it didn't detect a running operation.
2022-08-24 01:43:42 +02:00
David Taylor b01b1570ab
FIX: Handle enum types during database restore (#16624)
c1db9687 introduced an postgres enum type. Our database restore logic did not handle custom types correctly, and would therefore raise a 'type already exists' error when restoring any backup.

This commit adds restore handling for enums, mirroring the similar logic for tables and views.
2022-05-04 08:40:34 +10:00
Osama Sayegh 45ccadeeeb
DEV: Upgrade Rails to 6.1.3.1 (#12688)
Rails 6.1.3.1 deprecates a few API and has some internal changes that break our tests suite, so this commit fixes all the deprecations and errors and now Discourse should be fully compatible with Rails 6.1.3.1. We also have a new release of the rails_failover gem that's compatible with Rails 6.1.3.1.
2021-04-21 12:36:32 +03:00
Gerhard Schlager 57095f0bb7 FIX: Killing a Unicorn worker shouldn't kill a running backup or restore process
By spawning and forking the backup and restore, the process owner changes from 🦄 to the init process.
2020-10-13 19:48:53 +02:00
David Taylor fe932eb644
FIX: Ensure multisite DB is set correctly when spawning backup process
Followup to 76477a1c8b
2020-09-18 20:06:49 +01:00
Gerhard Schlager 76477a1c8b FIX: Forking prevented notifications from being sent after backup
This is a workaround for https://github.com/rubyjs/mini_racer/issues/175
2020-09-18 17:35:17 +02:00
Gerhard Schlager 859d9b75a7 FIX: Restoring backup from PG12 could fail on PG10
The `EXECUTE FUNCTION` syntax for `CREATE TRIGGER` statements was introduced in PostgreSQL 11. We need to replace `EXECUTE FUNCTION` with `EXECUTE PROCEDURE` in order to be able to restore backups created with PG12 on PG10.
2020-06-16 16:04:14 +02:00
Gerhard Schlager 13b4eb9cce FIX: Restore failed if schema contained objects not owned by the current DB user 2020-04-01 18:04:43 +02:00
Gerhard Schlager 5889309d3b FIX: Restoring with `disable_emails: false` didn't work anymore 2020-03-02 17:44:01 +01:00
Gerhard Schlager e474cda321 REFACTOR: Restoring of backups and migration of uploads to S3 2020-01-14 11:41:35 +01:00
Joffrey JAFFEUX 0d3d2c43a0
DEV: s/\$redis/Discourse\.redis (#8431)
This commit also adds a rubocop rule to prevent global variables.
2019-12-03 10:05:53 +01:00
Krzysztof Kotlarek 427d54b2b0 DEV: Upgrading Discourse to Zeitwerk (#8098)
Zeitwerk simplifies working with dependencies in dev and makes it easier reloading class chains. 

We no longer need to use Rails "require_dependency" anywhere and instead can just use standard 
Ruby patterns to require files.

This is a far reaching change and we expect some followups here.
2019-10-02 14:01:53 +10:00
Régis Hanol 5504622c1b rename export/import in favor of backup/restore for better consistency 2014-10-10 20:04:07 +02:00
Robin Ward 9e2c72e277 Allow restoring from backups in development mode even if the setting is
off.
2014-08-28 17:02:48 -04:00
Régis Hanol 8a20d05ba5 FEATURE: backup without uploads 2014-08-20 18:53:58 +02:00
Sam 070cdbe64b FIX: race condition 2014-08-19 16:25:57 +10:00
Régis Hanol 5f620c5b98 FIX: add port information when backuping/restoring 2014-07-30 17:20:25 +02:00
Régis Hanol 9befc31afa BUGFIX: restore wasn't working now that we have some views 2014-07-11 18:29:24 +02:00
Régis Hanol b52177a4b6 BUGFIX: better resiliency in the backup/restore processes 2014-05-13 16:18:22 +02:00
Sam f3cc7360e0 BUGFIX: Correct after_fork semantics
After fork SiteSettings was not getting a new process id,
causing site settings not to refresh properly in unicorn

This code also centralizes the logic
2014-03-31 12:34:13 +11:00
Régis Hanol 68a935c36b FEATURE: upload backups 2014-02-22 01:41:01 +01:00
Régis Hanol 918af0c6ee BUGFIX: make sure we can access db config hash with either strings or symbols 2014-02-20 19:11:43 +01:00
Régis Hanol 1f90f3044f BUGFIX: restore wasn't working when not using multisite in production 2014-02-20 18:42:17 +01:00
Régis Hanol 438f97d8b0 BUGFIX: backup/restore rake tasks weren't working 2014-02-19 15:25:31 +01:00
Régis Hanol a8b3269fdb reload the page when read_only mode is disabled 2014-02-14 00:27:25 +01:00
Régis Hanol b89d328de2 display/preload the logs of the last/current operation 2014-02-13 13:31:14 -08:00
Régis Hanol 6e44ca8e17 fix rollback 2014-02-13 13:31:14 -08:00
Régis Hanol d94774ceec force sidekiq resest after fork 2014-02-13 13:31:13 -08:00
Régis Hanol 79a40658bf new backup & restore code 2014-02-13 13:31:13 -08:00