Did you manually create the import
folder or was it there already?
If you created it, it probably also belongs to the root account which prevents files in there from being deleted.
You can verify the installation permissions using the command:
ls -lh /opt/mattermost
if the data
directory in there and all the other files belong to the mattermost
user, it is very likely that the import directory does not and you can fix that by running the command:
chown -R mattermost: /opt/mattermost/data
ok that seemed to work the import_process has now finished with status success. I’m assuming maybe just a reboot now as nothing is showing up?
OK, great!
You need to restart the mattermost service for the changes to be effective, try:
systemctl restart mattermost
hmmm did that still nothing shows up
did a full reboot and checked the team “slackimport” and only have the channels town square and off-topic with nothing there
It was a bit fast for the import, so I’m not sure if it actually did something, given the fact that the archive is 4.5GB in size.
Can you download the beta version of @plusmid 's new mmctl
build which also supports archive validation from here, please? You can do that directly on your Mattermost server using the following commands:
wget 'https://community.mattermost.com/files/fiinwbxwppg68eftofwd5fw3hw/public?h=APwtyR_jhvepkzH8b0j-REDcX4cwkLGKyM48d0Xehh8' -O mmctl-beta.zip
unzip mmctl-beta.zip
./mmctl import validate /path/to/your/mattermost-bulk-import.zip
and post the output then.
This tool should help us with identifying issues in your zip file (if any) and it will also post a summary of the users and channels to be imported.
unzip mmctl-beta.zip
root@mattermost ~# ./mmctl import validate /opt/mattermost/import/mattermost-bulk-import.zip
Predefined teams:
Validation complete
Error: error opening the import file "/opt/mattermost/import/mattermost-bulk-import.zip": open /opt/mattermost/import/mattermost-bulk-import.zip: no such file or directory
I think you mised the data
subdirectory here.
It should read ./mmctl import validate /opt/mattermost/data/import/mattermost-bulk-import.zip
if the file is still there. It might have been removed by the importer, though, but I hope you have another copy of it somewhere as mentioned earlier.
ugh… it is gone
the only copy i have is the one that was created via windows so i’ll need to start over here and do it all again
OK one thing that is a bit different here is now in my /opt/mattermost/data folder i have about 200 new subfolders all named by date in each of these folders is a subfolder “teams” then another subfolder then another named channels and another and another named users
Wondering if moving these folders is the fix or if i should delete them all and start over?
Hard to tell. Can you please run the import validator first to see if your file is OK before we continue with other approaches here?
I dont have the file anymore
OK, well, if you want to find out if the import worked, you will have to search for the names of your slack channels and check for the usernames to see if they’re there.
You can do that when logging in to your Mattermost server by hitting the CTRL-k
shortcut. If you cannot find what you’re looking for then most likely the import did not work out and we need to start over new. In this case I would also suggest to wipe the Mattermost installation and start over new, because there might be some conflicting data in the database and the filesystem now.
I’d suggest to do the following steps:
- Purge your existing Mattermost installation
- Purge the database
- Create a fresh installation, login there, set up your admin account and your team
mkdir /opt/mattermost/data/import && chown mattermost: /opt/mattermost/data/import
- Create the
mattermost-bulk-import.zip
file using the commands you already did directly on the Mattermost server - Run the
mmctl
import validator on themattermost-bulk-import.zip
file and post the output here
If the output of the importer looks sane, then:
- Create a snapshot of your Mattermost server virtual machine
UID=$(date +%s); cp mattermost-bulk-import.zip /opt/mattermost/data/import/${UID}_mattermost-bulk-import.zip && chown mattermost: /opt/mattermost/data/import/*.zip
mmctl import list available
mmctl import process ${UID}_mattermost-bulk-import.zip
im recreating that file now and will go from there
This is the wrong mmctl version, this is not the one out of the mmctl-beta.zip
file.
Could it be that you alread had a mmctl
binary in this directory and did not overwrite it when extracting from the zip?
To be safe, let’s create a new directory for it:
mkdir /root/mmctl-beta
cd /root/mmctl-beta
wget 'https://community.mattermost.com/files/fiinwbxwppg68eftofwd5fw3hw/public?h=APwtyR_jhvepkzH8b0j-REDcX4cwkLGKyM48d0Xehh8' -O mmctl-beta.zip
unzip mmctl-beta.zip
./mmctl import validate /opt/mattermost/data/import/mattermost-bulk-import.zip
ok - it is full of validation errors
import validation error in “mattermost-bulk-import.zip”->“mattermost_import.jsonl”:3180 field “post.team”: reference to unknown team “slackimport”
to be clear my old team in slack was not called “slackimport” but the new team i have setup in mattermost is called “slackimport”