Created .colpkg; invalid file format for Import

Crisis averted (sorta): I have found a solution, and although it produces errors, upon reopening the program, it imports everything (haven’t gone in-depth; could have some missing attributes somewhere).

This process excludes media in colpkg. If we’re lucky, someone will chime in on a fix for this part.

Step 1): Before you* do this, backup your colpkg. You’ve been warned!

On the duplicate colpkg, run the following commands (go to directory and right-click, then “Open in Terminal” if using Ubuntu 20.04).

I’m sure someone here will give some pointers on how to do this for Windows 10.

Step 2): Open Anki and create a New Profile:

File > Switch Profile… > Add > Enter name > Press OK > Open

This ensures any mishaps or erasures of other data do not interfere with your current profile. Do not skip this step: You’ve been warned.

Also, instead of “anki”, feel free to rename your colpkg to whatever works for you.

Step 3): Force conversion with ZIP:
sudo zip -FF ANKI-collection.colpkg --out anki.zip

Step 4): Set permissions to anybody (do not perform this chmod on system files or directories; is a nightmare and security risk):
sudo chmod 777 anki.zip

Step 5): Rename using the mv command:
mv anki.zip anki.colpkg

Step 6): Open Anki to the New Profile you’ve created, then:

File > Import… > Select your converted anki.colpkg file > Open

It will give you an error:

This will delete your existing collection and replace it with the data in the file you’re importing. Are you sure?

Because you’re on a New Profile, you’re not worried about the data loss, right? If you skipped that step where I said, “Create a New Profile”, then click "No and go back to Step 2).

Step 7): Click “OK”.

This step will produce the error:

The provided file is not a valid .apkg file.

Just accept the error. It’s okay, I promise.

Step 8): Now close & reopen Anki.

Step 9): Now that you have your collection loaded into Anki, create new exports, to save the repaired data.

Create a .colpkg and .apkg and select “All Decks” for each, in the profile you’ve imported the repaired colpkg file.

File > Export… > colpkg
File > Export… > apkg

Step 10): Go study and be good to each other.