Migration errors

Infos:

  • Used Zammad version: 5.4.0
  • Used Zammad installation type: source
  • Operating system: Ubuntu 22.04

Expected behavior:Sucessfull migration

Actual behavior: Migration with errors

Hello everyone!

I have a lot migration errors in process, would like to know if anyone has encountered anything similar. I think it’s problem with config files in /opt/zammad/config/database.yml, but i’m not sure. Some type of errors:

# Restoring PostgreSQL DB
ERROR:  relation "active_job_locks" already exists
STATEMENT:  CREATE TABLE public.active_job_locks (
    id integer NOT NULL,
    lock_key character varying,
    active_job_id character varying,
    created_at timestamp(3) without time zone,
    updated_at timestamp(3) without time zone
);
ERROR:  relation "active_job_locks_id_seq" already exists
STATEMENT:  CREATE SEQUENCE public.active_job_locks_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  insert or update on table "overviews_roles" violates foreign key constraint "fk_rails_fa1b820fe5"
DETAIL:  Key (overview_id)=(11) is not present in table "overviews".
STATEMENT:  COPY public.overviews_roles (overview_id, role_id) FROM stdin;

And more similar errors, but at the end migration is sucсessfull. If need more information about problem - i can provide more information upon request.

Your database is not empty. Zammads backup and restore do drop the database automatically for you.

In your case it seems that this has not happened. As you’re using a source code installation, running the script as root might be an issue, as your system doesn’t know how to handle rake and rails commands which are being used by our scripts.