Error importing .zip during migration from Cloud Free to Azure VM (using bitnami)

Summary
Error importing .zip during migration from Cloud Free to Azure VM (using bitnami).

Steps to reproduce
Reproduction might be a bit complicated since you do not have our data… well, you mattermost team actually do, since it is in your Cloud server. Followed instructions from Mattermost workspace migration — Mattermost documentation and after some hiccups, it got stuck in the next command:

mmctl import process 6hs5o4r4zf8tjgz5wg33h1o8xc_963zj1eo5tyy7pmzg9tohuqofc_export.zip

mmctl:
Version:        v7.8.1
GitCommit:      5d7058cf9320523700688f8d2161ca5c3a454d49
GitTreeState:   "clean"
BuildDate:      2023-02-16T10:15:09Z
GoVersion:      go1.18.1
Compiler:       gc
Platform:       linux/amd64

Expected behavior
Expected the command above to work to continue to last one: mmctl extract run… and have all my channels and content available in a local Azure VM.

Observed behavior
There are a lot of errors in the log but it ends with:

{"timestamp":"2023-06-13 14:51:03.672 Z","level":"error","msg":"Error attaching files to post.","caller":"app/import_functions.go:1628","post_id":"nm4z68fk4pg8zcxksad9pqwebc","post_file_ids":["t41er1zxk3gffbubezkeb1bucc","9nm47r68dbf85fqhjh4e8xhc4r","kwe9omr9mjg1pn7b7bbp8q9yqo"],"error":"invalid input: entity: FileInfo field: <id, postId, creatorId> value: <t41er1zxk3gffbubezkeb1bucc, nm4z68fk4pg8zcxksad9pqwebc, gmejfnzmkjnt5b5xsynphfkfuo>"}
{"timestamp":"2023-06-13 14:51:03.672 Z","level":"error","msg":"Error attaching files to post.","caller":"app/import_functions.go:1628","post_id":"nm4z68fk4pg8zcxksad9pqwebc","post_file_ids":["t41er1zxk3gffbubezkeb1bucc","9nm47r68dbf85fqhjh4e8xhc4r","kwe9omr9mjg1pn7b7bbp8q9yqo"],"error":"invalid input: entity: FileInfo field: <id, postId, creatorId> value: <9nm47r68dbf85fqhjh4e8xhc4r, nm4z68fk4pg8zcxksad9pqwebc, gmejfnzmkjnt5b5xsynphfkfuo>"}
{"timestamp":"2023-06-13 14:51:03.672 Z","level":"error","msg":"Error attaching files to post.","caller":"app/import_functions.go:1628","post_id":"nm4z68fk4pg8zcxksad9pqwebc","post_file_ids":["t41er1zxk3gffbubezkeb1bucc","9nm47r68dbf85fqhjh4e8xhc4r","kwe9omr9mjg1pn7b7bbp8q9yqo"],"error":"invalid input: entity: FileInfo field: <id, postId, creatorId> value: <kwe9omr9mjg1pn7b7bbp8q9yqo, nm4z68fk4pg8zcxksad9pqwebc, gmejfnzmkjnt5b5xsynphfkfuo>"}
{"timestamp":"2023-06-13 14:51:05.607 Z","level":"error","msg":"Failed to upload file","caller":"app/import_functions.go:1311","error":"GetInfoForBytes: Could not decode gif., gif: not enough image data","file_name":"data/20230403/teams/noteam/channels/9rqff4mtf7bdtk1p77yc1o7yde/users/czgbk4x18pbt9djossa58jbe7w/mgj4k6knypd1d8punym7djg1ky/FlySwatterGIF.gif"}
{"timestamp":"2023-06-13 14:51:05.607 Z","level":"warn","msg":"failed to import attachment","caller":"app/import_functions.go:1610","path":"data/20230403/teams/noteam/channels/9rqff4mtf7bdtk1p77yc1o7yde/users/czgbk4x18pbt9djossa58jbe7w/mgj4k6knypd1d8punym7djg1ky/FlySwatterGIF.gif","error":"GetInfoForBytes: Could not decode gif., gif: not enough image data"}
{"timestamp":"2023-06-13 14:51:12.933 Z","level":"error","msg":"SimpleWorker: job execution error","caller":"jobs/base_workers.go:91","worker":"ImportProcess","job_id":"m8r3kawaj7dpupqgz8fjirnado","error":"Post.IsValid: Invalid type., id=reminder"}

Hi @nrod and welcome to the Mattermost forums!

This is just a wild guess, but it seems to stop when trying to import a post reminder and based on your mmctl version, you’re on a version that does not have post reminder support, so this is somehow expected.
What Mattermost server version did you install? Usually it’s bundled with the mmctl version, so I assume you’re running 7.8.1 and post reminders have been added with 7.10, so if you’re not running on 7.10.2 locally, please upgrade first (or do a fresh install) before trying to import the data from the cloud.

Hello @agriesser. Thank you for your reply.
I installed a Bitnami package found in the Azure Marketplace. It came indeed with version 7.8.1. I installed the same version locally to perform the operations.
I also have 7.10.2 locally, just not in the server. Can you give me a hint on how to upgrade it in the Bitnami package I installed in my virtual machine? I will repeat all this with the latest version.
Best regards!

UPDATE: @agriesser, nevermind my question… I will just copy the mmctl file to my Azure VM… it should work. Thanks again! :100: I will come back with my findings…

It seems that something is still off… used the newest version in the server, updated the version in properties.ini file, restarted the server but still I get the version warning and the cmd ./mmctl import process kyh4type33nd8k9tsit1hq1z1o_kxmdz9wchib59q84rppfxqn3re_export.zip caused apparently the same error as before.

WARNING: server version 7.8.1.7.8.1.b41891c14d4ca8beda19d9a4fb485df0.false doesn't match mmctl version v7.10.2
  ID: 9i5ryz16a3ysjxb9erdqc839mw
  Status: error
  Created: 2023-06-14 09:54:44 +0100 WEST
  Started: 2023-06-14 09:54:47 +0100 WEST
  Data: map[error:Error during job execution. — Post.IsValid: Invalid type., id=reminder import_file:kyh4type33nd8k9tsit1hq1z1o_kxmdz9wchib59q84rppfxqn3re_export.zip line_number:1033]

Getting the right version in the server could still be the answer? What am I missing here?

mmctl is not the problem, it just indicated that your server version is too old and the server version is the problem here, so you would need to upgrade your Bitnami installation of 7.8.1 to 7.10.2.
I’m not sure how to do that off the top of my head, but from what I remember when I looked at bitnami some time ago it’s just a preconfigured environment where you can follow the standard Mattermost upgrade procedure to get your system updated to 7.10.2:

https://docs.mattermost.com/upgrade/upgrading-mattermost-server.html

1 Like

BTW, just stumbled upon that in another thread: Bitnami offers 7.10.2 out of the box:

https://bitnami.com/stack/mattermost/virtual-machine

1 Like

@agriesser thank you for your last messages.
I am now in the process of checking my latest import since it loaded way more content than the first one, despite the error. If the content is all there, then the error should have happened almost at the end of the import process and that might mean that we can go on from here.
I will keep your URLs for a rainy day… and I already checked Azure Marketplace as well. The version there is now the 7.10.2 as well… kinda missed it for just a couple weeks.
:wave:t3:

PS: I marked your last URL post as the solution assuming that having both servers in the latest version won’t cause any issues with the import. After all, everything else worked just fine.

Awesome, thanks for letting us know that your issue is fixed :slight_smile: