Bug #30156
closedLocal database backup/restore doesn't work
Description
Testing backup and restore. If postgres is local, it copies the data dir, otherwise it does a pg_dump. When performing a restore, the restore of the data dir doesn't work correctly. The database is basically empty, and there are some consistency errors (I get errors like "Can't find product "2""). However, I tested doing a pg_dump -c for each database (foreman, candlepin, and pulpcore), and restoring those files worked, the data is there, hammer commands (and ui) shows information. I haven't dug into how the data_dir backup and restore is done to say where the problem might lie.
An option would be to add a parameter specifying a pg_dump, regardless of whether db is local or not.
This ticket could track the fix of this, and possibly the addition of the parameter.
Updated by Lance Dillon over 4 years ago
The option --include-db-dumps takes care of that, but since the local copy doesn't seem to work, maybe this should be included by default?
Updated by Amit Upadhye over 4 years ago
Lance Dillon wrote:
The option --include-db-dumps takes care of that, but since the local copy doesn't seem to work, maybe this should be included by default?
Were you using foreman 2.0 or higher while taking backup and restore ? I think this issue is similar to https://projects.theforeman.org/issues/30469 . The pr has been created, request to check if it works for you.
Thank You.