Migrate instance from SQLite to Postgres

Hello,

I am currently in the process of exporting data from an existing Directus instance (using SQLite) and importing it into a new Directus instance running on PostgreSQL.
I am using the official template CLI tool for the export and import.

During the import into the new instance, I encounter several error messages.
After the import completes, I noticed that although the translation table is present and populated correctly, the link between the models and their corresponding translations (“translate link”) is missing.

Do you have any idea what could be causing this issue?
Are there any additional steps or considerations when migrating data between different database types to ensure that relationships are preserved correctly?

Thank you very much in advance for your support!

Logs
Log:
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "tags_translations" add constraint 
 ›   "tags_translations_tags_id_foreign" foreign key ("tags_id") references 
 ›   "tags" ("id") on update NO ACTION on delete SET NULL - foreign key 
 ›   constraint "tags_translations_tags_id_foreign" cannot be implemented 
 ›   (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "episode_tags" add constraint 
 ›   "episode_tags_episode_id_foreign" foreign key ("episode_id") references 
 ›   "episode" ("id") on update NO ACTION on delete SET NULL - foreign key 
 ›   constraint "episode_tags_episode_id_foreign" cannot be implemented 
 ›   (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "episode_tags" add constraint 
 ›   "episode_tags_tags_id_foreign" foreign key ("tags_id") references "tags" 
 ›   ("id") on update NO ACTION on delete SET NULL - foreign key constraint 
 ›   "episode_tags_tags_id_foreign" cannot be implemented (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "episode_translations" add constraint
 ›    "episode_translations_episode_id_foreign" foreign key ("episode_id") 
 ›   references "episode" ("id") on update NO ACTION on delete SET NULL - 
 ›   foreign key constraint "episode_translations_episode_id_foreign" cannot be
 ›    implemented (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "podcast" add constraint 
 ›   "podcast_user_updated_foreign" foreign key ("user_updated") references 
 ›   "directus_users" ("id") on update NO ACTION on delete NO ACTION - foreign 
 ›   key constraint "podcast_user_updated_foreign" cannot be implemented 
 ›   (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "podcast" add constraint 
 ›   "podcast_user_created_foreign" foreign key ("user_created") references 
 ›   "directus_users" ("id") on update NO ACTION on delete NO ACTION - foreign 
 ›   key constraint "podcast_user_created_foreign" cannot be implemented 
 ›   (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "podcast_translations" add constraint
 ›    "podcast_translations_podcast_id_foreign" foreign key ("podcast_id") 
 ›   references "podcast" ("id") on update NO ACTION on delete SET NULL - 
 ›   foreign key constraint "podcast_translations_podcast_id_foreign" cannot be
 ›    implemented (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "episode" add constraint 
 ›   "episode_podcast_foreign" foreign key ("podcast") references "podcast" 
 ›   ("id") on update NO ACTION on delete SET NULL - foreign key constraint 
 ›   "episode_podcast_foreign" cannot be implemented (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "episode" add constraint 
 ›   "episode_user_updated_foreign" foreign key ("user_updated") references 
 ›   "directus_users" ("id") on update NO ACTION on delete NO ACTION - foreign 
 ›   key constraint "episode_user_updated_foreign" cannot be implemented 
 ›   (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "episode" add constraint 
 ›   "episode_user_created_foreign" foreign key ("user_created") references 
 ›   "directus_users" ("id") on update NO ACTION on delete NO ACTION - foreign 
 ›   key constraint "episode_user_created_foreign" cannot be implemented 
 ›   (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "articles_files" add constraint 
 ›   "articles_files_articles_id_foreign" foreign key ("articles_id") 
 ›   references "articles" ("id") on update NO ACTION on delete SET NULL - 
 ›   foreign key constraint "articles_files_articles_id_foreign" cannot be 
 ›   implemented (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "articles_files" add constraint 
 ›   "articles_files_directus_files_id_foreign" foreign key 
 ›   ("directus_files_id") references "directus_files" ("id") on update NO 
 ›   ACTION on delete SET NULL - foreign key constraint 
 ›   "articles_files_directus_files_id_foreign" cannot be implemented (Status: 
 ›   500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "newsticker_globals_translations" add
 ›    constraint "newsticker_globals_translations_newsticker__32c8494b_foreign"
 ›    foreign key ("newsticker_globals_id") references "newsticker_globals" 
 ›   ("id") on update NO ACTION on delete SET NULL - foreign key constraint 
 ›   "newsticker_globals_translations_newsticker__32c8494b_foreign" cannot be 
 ›   implemented (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "articles" add constraint 
 ›   "articles_user_updated_foreign" foreign key ("user_updated") references 
 ›   "directus_users" ("id") on update NO ACTION on delete NO ACTION - foreign 
 ›   key constraint "articles_user_updated_foreign" cannot be implemented 
 ›   (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "articles" add constraint 
 ›   "articles_user_created_foreign" foreign key ("user_created") references 
 ›   "directus_users" ("id") on update NO ACTION on delete NO ACTION - foreign 
 ›   key constraint "articles_user_created_foreign" cannot be implemented 
 ›   (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "articles_translations" add 
 ›   constraint "articles_translations_articles_id_foreign" foreign key 
 ›   ("articles_id") references "articles" ("id") on update NO ACTION on delete
 ›    SET NULL - foreign key constraint 
 ›   "articles_translations_articles_id_foreign" cannot be implemented (Status:
 ›    500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "articles_translations_files" add 
 ›   constraint "articles_translations_files_directus_files_id_foreign" foreign
 ›    key ("directus_files_id") references "directus_files" ("id") on update NO
 ›    ACTION on delete SET NULL - foreign key constraint 
 ›   "articles_translations_files_directus_files_id_foreign" cannot be 
 ›   implemented (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
Loading 28 relations... done
Loading 3 roles... done
Loading 4 policies... done
Loading 18 permissions... done
Loading 7 users... done
Loading 4 accesses... done
Loading 2 folders... done
Loading 41 files... done
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed with status 400. Not retrying. Directus Error: Value for field "id" in collection "articles" has to be unique. (Status: 400) {"collection":"articles","field":"id","code":"RECORD_NOT_UNIQUE"}
 ›   Warning: Directus Error: Value for field "id" in collection "articles" has
 ›    to be unique. (Status: 400) 
 ›   {"collection":"articles","field":"id","code":"RECORD_NOT_UNIQUE"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed with status 400. Not retrying. Directus Error: Value for field "id" in collection "episode" has to be unique. (Status: 400) {"collection":"episode","field":"id","code":"RECORD_NOT_UNIQUE"}
 ›   Warning: Directus Error: Value for field "id" in collection "episode" has 
 ›   to be unique. (Status: 400) 
 ›   {"collection":"episode","field":"id","code":"RECORD_NOT_UNIQUE"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed with status 400. Not retrying. Directus Error: Value for field "id" in collection "episode" has to be unique. (Status: 400) {"collection":"episode","field":"id","code":"RECORD_NOT_UNIQUE"}
 ›   Warning: Directus Error: Value for field "id" in collection "episode" has 
 ›   to be unique. (Status: 400) 
 ›   {"collection":"episode","field":"id","code":"RECORD_NOT_UNIQUE"}
-- Request failed with status 400. Not retrying. Directus Error: Value for field "id" in collection "podcast" has to be unique. (Status: 400) {"collection":"podcast","field":"id","code":"RECORD_NOT_UNIQUE"}
 ›   Warning: Directus Error: Value for field "id" in collection "podcast" has 
 ›   to be unique. (Status: 400) 
 ›   {"collection":"podcast","field":"id","code":"RECORD_NOT_UNIQUE"}
-- Request failed with status 400. Not retrying. Directus Error: Value for field "id" in collection "tags" has to be unique. (Status: 400) {"collection":"tags","field":"id","code":"RECORD_NOT_UNIQUE"}
 ›   Warning: Directus Error: Value for field "id" in collection "tags" has to 
 ›   be unique. (Status: 400) 
 ›   {"collection":"tags","field":"id","code":"RECORD_NOT_UNIQUE"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: select "articles"."id", "articles"."status", 
 ›   "articles"."sort", "articles"."user_created", "articles"."date_created", 
 ›   "articles"."user_updated", "articles"."date_updated", "articles"."name", 
 ›   "articles"."published_date", "articles"."tag", "articles"."article_type", 
 ›   "articles"."translations" from "articles" where ("articles"."id" in ($1)) 
 ›   order by "articles"."sort" asc limit $2 - column articles.translations 
 ›   does not exist (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Max retries reached, not retrying further
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: select "episode"."id", "episode"."status", 
 ›   "episode"."sort", "episode"."user_created", "episode"."date_created", 
 ›   "episode"."user_updated", "episode"."date_updated", "episode"."podcast", 
 ›   "episode"."title", "episode"."podcast_url", "episode"."podcast_start", 
 ›   "episode"."podcast_end", "episode"."url_apple", "episode"."url_amazon", 
 ›   "episode"."url_spotify", "episode"."cover", "episode"."date", 
 ›   "episode"."tags", "episode"."translations" from "episode" where 
 ›   ("episode"."id" in ($1)) order by "episode"."sort" asc limit $2 - column 
 ›   episode.tags does not exist (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
 ›   Warning: Directus Error: select "episode"."id", "episode"."status", 
 ›   "episode"."sort", "episode"."user_created", "episode"."date_created", 
 ›   "episode"."user_updated", "episode"."date_updated", "episode"."podcast", 
 ›   "episode"."title", "episode"."podcast_url", "episode"."podcast_start", 
 ›   "episode"."podcast_end", "episode"."url_apple", "episode"."url_amazon", 
 ›   "episode"."url_spotify", "episode"."cover", "episode"."date", 
 ›   "episode"."tags", "episode"."translations" from "episode" where 
 ›   ("episode"."id" in ($1)) order by "episode"."sort" asc limit $2 - column 
 ›   episode.tags does not exist (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: select "podcast"."id", "podcast"."status", 
 ›   "podcast"."sort", "podcast"."user_created", "podcast"."date_created", 
 ›   "podcast"."user_updated", "podcast"."date_updated", "podcast"."title", 
 ›   "podcast"."cover", "podcast"."rss_feed", "podcast"."episodes", 
 ›   "podcast"."translations" from "podcast" where ("podcast"."id" in ($1)) 
 ›   order by "podcast"."sort" asc limit $2 - column podcast.episodes does not 
 ›   exist (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: select "tags"."id", "tags"."sort", "tags"."key", 
 ›   "tags"."translations" from "tags" where ("tags"."id" in ($1)) order by 
 ›   "tags"."sort" asc limit $2 - column tags.translations does not exist 
 ›   (Status: 500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: select "newsticker_globals"."id", 
 ›   "newsticker_globals"."force_update", "newsticker_globals"."translations" 
 ›   from "newsticker_globals" where ("newsticker_globals"."id" in ($1)) order 
 ›   by "newsticker_globals"."id" asc limit $2 - column 
 ›   newsticker_globals.translations does not exist (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
Loading data for 15 collections... done
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "tags" alter column "id" drop not 
 ›   null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "languages" alter column "code" drop 
 ›   not null - column "code" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "tags_translations" alter column "id"
 ›    drop not null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "episode_tags" alter column "id" drop
 ›    not null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "episode_translations" alter column 
 ›   "id" drop not null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "podcast" alter column "id" drop not 
 ›   null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "podcast_translations" alter column 
 ›   "id" drop not null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "episode" alter column "id" drop not 
 ›   null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "articles_files" alter column "id" 
 ›   drop not null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "newsticker_globals_translations" 
 ›   alter column "id" drop not null - column "id" is in a primary key (Status:
 ›    500) {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "articles" alter column "id" drop not
 ›    null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "newsticker_globals" alter column 
 ›   "id" drop not null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "articles_translations" alter column 
 ›   "id" drop not null - column "id" is in a primary key (Status: 500) 
 ›   {"code":"INTERNAL_SERVER_ERROR"}
-- Request failed. Retrying after 1000ms
-- Retrying job (attempt 1)
-- Request failed. Retrying after 2000ms
-- Retrying job (attempt 2)
-- Request failed. Retrying after 4000ms
-- Retrying job (attempt 3)
-- Max retries reached, not retrying further
 ›   Warning: Directus Error: alter table "articles_translations_files" alter 
 ›   column "id" drop not null - column "id" is in a primary key (Status: 500)

Because of the nature of the differences between SQLite and Postgres - we highly recommend against trying to go from SQLite to Postgres or Postgres to SQLite using the directus-template-cli tooling.

That said, I know that’s not much help if you’re already there though :sweat_smile:

The npx directus-template-cli@latest apply command is non-desctructive - in that it tries to update or add collections, fields, and relations - never delete.

This is the desired behavior for templates built by our Core Team here at Directus because we want folks to be able to stack one or two templates together into one instance if they want.

For your situation - if you’re moving to a fresh Postgres database - I’d look at trying to migrate over the schema using the Schema endpoints and the process that goes along with those.

Here’s a short guide on Schema Changes across Environments.

If that still doesn’t work – you may end up having to manually recreate those relationships between the different collections (tables).