The discussion is about a restore failure with a “hotlinked_media_status” already exists error. pfaffman is trying to restore a site from a prod environment to a staging site, but encounters the error. david asks about the restoration method, and pfaffman explains that he is restoring from the command line using a backup from S3. david finds it surprising that the issue is occurring without other reports. pfaffman successfully restores the backup on his dev box, and solves the issue by dropping the database. RGJ suggests that the error is a symptom of a bigger problem, likely related to BackupRestore.move_tables_between_schemas(MAIN_SCHEMA, BACKUP_SCHEMA) failing to work correctly, as removing the hotlinked_media_status type manually causes the restore to fail on the next statement.
Maybe not? I did successfully restore that same backup on my dev box.
Do you have any idea what I might have done to cause this or what I can do to fix it? I dropped the database and than was able to restore. Dropping the database was the actual solution, but I don’t deserve a solution for a problem I (seem to have) caused.
One very valuable insight that I just had is that hotlinked_media_status is simply the first thing happening in the restore file. If you remove it manually in the existing database the restore will fail on the next statement (CREATE TABLE public.admin_notices).
So this is not about that specific type definition. It’s just a symptom of a bigger problem, I suspect that BackupRestore.move_tables_between_schemas(MAIN_SCHEMA, BACKUP_SCHEMA) fails to do what it’s gotta do.