11# Archive Command
22
3- The ` archive ` command saves your Slack workspace as a directory of files . By
3+ The ` archive ` command saves your Slack workspace as a SQLite database . By
44default, it archives the entire workspace that your user can access. You can
55customize the archive to include specific channels, groups, or direct messages
6- by providing their URLs or IDs.
6+ by providing their URLs or IDs on the command line or in the Wizard.
7+
8+ The database is located in ` slackdump.sqlite ` in the output directory.
9+
10+ Alternatively, you can use ` -legacy ` flag to archive into chunk file format, if
11+ you experience problems with the database. Note, that ` -legacy ` flag is
12+ temporary for the transition period, and will be removed in v3.2.0.
13+ <!-- TODO: remove above paragraph once -legacy is deleted -->
714
815The benefits of using "Archive" over "Export" and "Dump" are:
9- - it is well documented (see ` slackdump help chunk ` );
16+ - it is faster, because it does not need to convert the data to export or dump
17+ formats;
18+ - the database can be easily queried using SQL using SQLite CLI or SQLite
19+ Browser;
20+ - the archiving can be "resumed" by ` resume ` command, meaning that you can
21+ continue where you left off in case of previous failure or incremental
22+ backups.
1023- it can be converted to other formats, including the native Slack Export
1124 format (see ` slackdump help convert ` );
12- - it is easier to parse with tools like ` jq ` or ` grep ` ;
1325- it is more convenient to build your own tools around it;
1426- it is used internally by Slackdump to generate Slack Export and dump files,
1527 so it can be seen as "master" format for the data;
16- - It is natively supported by ` slackdump view ` command, everything else uses
17- an adapter.
1828
1929## Features
2030
21- ### Default Behaviour
22- - Archives the full workspace accessible to your user.
31+ ## Database Archive Contents
32+
33+ The archive contains the following files:
34+
35+ - ** ` slackdump.sqlite ` ** : The SQLite database file containing all the data
36+ from the workspace.
37+ - ** ` __uploads ` ** : A directory containing files attached to messages that were
38+ downloaded, if the file download is enabled.
39+ - ** ` __avatars ` ** : A directory containing user avatars that were downloaded,
40+ if the avatar download is enabled.
41+
42+ Sometimes you might see ` slackdump.sqlite-shm ` and ` slackdump.sqlite-wal ` files
43+ in the output directory. These are temporary files created by SQLite for
44+ performance reasons. They are not necessary for the archive, unless Slackdump
45+ was interrupted or crashed. You can safely delete them if you are sure that the
46+ archive is complete.
2347
24- ### Optional Customization
25- - Specify channels, groups, or DMs to archive by providing their URLs or IDs.
48+ ### Database Structure
2649
27- ### Output Format
28- - The archive uses the ** "Chunk" format** , which can be:
29- - Viewed using the ` view ` command.
30- - Converted to other formats, including the native Slack Export format.
50+ The database contains the following tables:
51+ - ** CHANNEL** : Contains all channels in the workspace.
52+ - ** CHANNEL_USER** : Contains the mapping between channels and users.
53+ - ** CHUNK** : Contains the "chunk" metadata, including the chunk type, number
54+ of records retrieved and the SESSION ID.
55+ - ** FILE** : Contains all discovered file metadata from messages.
56+ - ** MESSAGE** : Contains all messages and thread messages from the workspace.
57+ - ** SEARCH_FILE** : Contains search results for files.
58+ - ** SEARCH_MESSAGE** : Contains search results for messages.
59+ - ** SESSION** : Contains the session information, including the start and end
60+ time of the period.
61+ - ** S_USER** : Contains all users in the workspace.
62+ - ** WORKSPACE** : Contains the workspace information, including the workspace ID
63+ and name.
3164
32- ## Archive Contents
65+ There are also additional views, starting with ` V_ ` , which are used by Slackdump
66+ during the archiving process, they should not be removed or modified.
67+
68+ ## Legacy Archive Contents
3369
3470The archive behaves like the Slackdump export feature. A successful run
3571output includes:
@@ -49,8 +85,17 @@ output includes:
4985- Note: The ` archive ` command does not create ZIP files, but you can manually
5086 compress the output directory into a ZIP file if needed.
5187
52- ## What is the Chunk Format?
88+ For details on this format, run: ` slackdump help chunk `
89+
90+ ## Migrating from v3.x
91+ If you're using Chunk files in your tooling, you can convert the database to the
92+ chunk format using the ` convert ` command. For example:
93+ ``` bash
94+ slackdump convert -f chunk ./slackdump_20211231_123456
95+ ```
5396
54- The Chunk format is a specific structure used for archiving data. For details
55- on this format, run: ` slackdump help chunk `
97+ or
5698
99+ ``` bash
100+ slackdump convert -f chunk ./slackdump_20211231_123456/slackdump.sqlite
101+ ```
0 commit comments