Actions
Bug #17474
closeddb:import_dump does not clean existing database prior to re-importing
Description
It might be lack of my understanding / docs, but trying to use backup and restore on another server, the sequence that I've done was:
1. backup old server (as described in the manual)
2. create a new server, run foreman installer (so new database gets created) followed by a db restore (and recovering /etc/foreman and puppet ssl dir).
at that point, the recovery fails, as the existing database already is migrated (even if its the same version) so fk errors are present, for example:
pg_restore: [archiver (db)] could not execute query: ERROR: constraint "tokens_host_id_fk" for relation "tokens" already exists Command was: ALTER TABLE ONLY tokens ADD CONSTRAINT tokens_host_id_fk FOREIGN KEY (host_id) REFERENCES hosts(id);
the solution was to add --clean to the backup rake task prior.
Updated by The Foreman Bot almost 8 years ago
- Status changed from New to Ready For Testing
- Assignee set to Ohad Levy
- Pull request https://github.com/theforeman/foreman/pull/4046 added
Updated by Daniel Lobato Garcia almost 8 years ago
- Related to Bug #17488: Add confirmation step to db:import task added
Updated by Ohad Levy almost 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset d39ced29daf3ad70f6af4881e2bc18b38e80ca31.
Updated by Dominic Cleal almost 8 years ago
- Translation missing: en.field_release set to 189
Actions