CSV
The CSV importer allows you to import your own plain text files, however it does require the zip file to be in a specific format for the importer to understand.
The Zip File
The zip file must be a flat zip, which means there can not be a "root" or "sub" folder in which the items reside in the zip file. The importer looks for the files channels.csv
and users.csv
immediately inside the zip and not inside of any folder. If you have any questions about this, please ask in #support channel on the Community server.
The directmessages directory is a special directory name, check Direct Messages section below.
channels.csv Format
Channels between 2 users (Direct Messages) should not be included on this file. See section Direct Messages for more information.
The channels.csv
requires a very specific structure and layout. Each line contains information about one channel. Each line must include the channel name, the creator, whether it is private or public, and the members in the channel separated by a semicolon ;
. Quotes are required.
Channel name
Username of the channel creator
Whether the channel is public or private. If the last argument is not
private
it is assumed the channel is public.List of users in the channel, separated by semicolons. If only the creator is in the channel, then there must be empty quotes.
users.csv Format
The users.csv
is a file which contains the user details, each line containing a new user and the user details is:
Username (must not contain @ and some other special characters)
Email
Name
Message Files
The message csv files require a very specific format. Each line contains a new message, every piece of information is requires quotes to surround it, there cannot be any spaces between the commas. The details required are:
Username who sent the message
The timestamp in milliseconds
The message, quotes are highly recommended especially if the message text contains a comma.
Direct Messages / Direct Channels
Direct Channels / Direct Messages are imported from a special directory named directmessages with a specific format based on the Message Files format. The details required are:
Username who sent the message
Username who received the message
The timestamp in milliseconds
The message, quotes are highly recommended especially if the message text contains a comma.
It's required to keep conversations in distinct files, for example, a conversation between user A and B compose a file (messages1.csv
), and the conversation between user B and C compose another file (messages2.csv
).
Importing
Once you have that all set up and zipped, then you can start the import process.
Go to
https://[your_rocketchat]/admin/import/prepare/csv
Choose your
.zip
file and wait until Ministry.Chat can read it (it can take a few minutes, depending on the size of the file)Deselect any items you don't want to import
At the top of the page, click on Start Importing
When you have problems during the Import, click on "View Logs" in the admin section to get the detailed error messages.
Last updated