Signal-Desktop: how to export messages?












0















How can signal-desktop messages be exported?



I want to backup my correspondence.



Is it possible at all?










share|improve this question



























    0















    How can signal-desktop messages be exported?



    I want to backup my correspondence.



    Is it possible at all?










    share|improve this question

























      0












      0








      0








      How can signal-desktop messages be exported?



      I want to backup my correspondence.



      Is it possible at all?










      share|improve this question














      How can signal-desktop messages be exported?



      I want to backup my correspondence.



      Is it possible at all?







      backup






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 21:18









      Gen.StackGen.Stack

      1447




      1447






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Yes, it is possible.



          Just save this in a file <yourFilename>:



          sigBase="${HOME}/.config/Signal/";
          key=$( /usr/bin/jq -r '."key"' ${sigBase}config.json );
          db="${HOME}/.config/Signal/sql/db.sqlite";
          clearTextMsgs="${sigBase}clearTextMsgs.csv";

          /usr/bin/sqlcipher -list -noheader "$db" "PRAGMA key = "x'"$key"'";select json from messages;" > "$clearTextMsgs";


          and call it via bash <yourFilename>. Or render it executable with chmod 700 <yourFilename> and call it directly: ./<yourFilename>



          This script uses sqlcipher and jq with signal-desktop's database key to open, decrypt and extract all messages in JSON format into clearTextMsgs.csv inside your signal-desktop folder ~/.config/Signal.



          Besides the key extraction by filtering JSON with jq (from ~/.config/Signal/config.json), the crucial bit happens here:



          sqlcipher -list -noheader <DB> <SQL>


          where <SQL> contains the PRAGMA key definition and the actual SQL statement (SELECT json FROM messages;).



          One can then use jq to access any key/value from the messages backup.



          Maybe you have to install sqlcipher and jq for that:



          apt install sqlcipher jq


          Note:



          While this does extract all messages, we need to specify that "all" in signal-desktop has the meaning of "all messages actually loaded". So, in order to extract every single message, the slider of the active contact has to be slid way up, then signal-desktop will load previously not availalble messages (lather rinse repeat until satisfied). Do so as far in the past you would want your messages loaded. This gets tedious quite quickly. Remember to do so for all of your contacts' histories.



          Having that said, it is technically feasable to backup your message history, in practice it is a manual job. A way around this might be a cron job backing up all recent messages, maybe once a day. Then this is likely to contain duplicates and might miss messages in case signal-desktop has been restarted.



          In any case, this method is working fine if the (not too far -- read: a couple of months maybe) history is to be searched programmatically once in a while.






          share|improve this answer


























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f505008%2fsignal-desktop-how-to-export-messages%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Yes, it is possible.



            Just save this in a file <yourFilename>:



            sigBase="${HOME}/.config/Signal/";
            key=$( /usr/bin/jq -r '."key"' ${sigBase}config.json );
            db="${HOME}/.config/Signal/sql/db.sqlite";
            clearTextMsgs="${sigBase}clearTextMsgs.csv";

            /usr/bin/sqlcipher -list -noheader "$db" "PRAGMA key = "x'"$key"'";select json from messages;" > "$clearTextMsgs";


            and call it via bash <yourFilename>. Or render it executable with chmod 700 <yourFilename> and call it directly: ./<yourFilename>



            This script uses sqlcipher and jq with signal-desktop's database key to open, decrypt and extract all messages in JSON format into clearTextMsgs.csv inside your signal-desktop folder ~/.config/Signal.



            Besides the key extraction by filtering JSON with jq (from ~/.config/Signal/config.json), the crucial bit happens here:



            sqlcipher -list -noheader <DB> <SQL>


            where <SQL> contains the PRAGMA key definition and the actual SQL statement (SELECT json FROM messages;).



            One can then use jq to access any key/value from the messages backup.



            Maybe you have to install sqlcipher and jq for that:



            apt install sqlcipher jq


            Note:



            While this does extract all messages, we need to specify that "all" in signal-desktop has the meaning of "all messages actually loaded". So, in order to extract every single message, the slider of the active contact has to be slid way up, then signal-desktop will load previously not availalble messages (lather rinse repeat until satisfied). Do so as far in the past you would want your messages loaded. This gets tedious quite quickly. Remember to do so for all of your contacts' histories.



            Having that said, it is technically feasable to backup your message history, in practice it is a manual job. A way around this might be a cron job backing up all recent messages, maybe once a day. Then this is likely to contain duplicates and might miss messages in case signal-desktop has been restarted.



            In any case, this method is working fine if the (not too far -- read: a couple of months maybe) history is to be searched programmatically once in a while.






            share|improve this answer






























              0














              Yes, it is possible.



              Just save this in a file <yourFilename>:



              sigBase="${HOME}/.config/Signal/";
              key=$( /usr/bin/jq -r '."key"' ${sigBase}config.json );
              db="${HOME}/.config/Signal/sql/db.sqlite";
              clearTextMsgs="${sigBase}clearTextMsgs.csv";

              /usr/bin/sqlcipher -list -noheader "$db" "PRAGMA key = "x'"$key"'";select json from messages;" > "$clearTextMsgs";


              and call it via bash <yourFilename>. Or render it executable with chmod 700 <yourFilename> and call it directly: ./<yourFilename>



              This script uses sqlcipher and jq with signal-desktop's database key to open, decrypt and extract all messages in JSON format into clearTextMsgs.csv inside your signal-desktop folder ~/.config/Signal.



              Besides the key extraction by filtering JSON with jq (from ~/.config/Signal/config.json), the crucial bit happens here:



              sqlcipher -list -noheader <DB> <SQL>


              where <SQL> contains the PRAGMA key definition and the actual SQL statement (SELECT json FROM messages;).



              One can then use jq to access any key/value from the messages backup.



              Maybe you have to install sqlcipher and jq for that:



              apt install sqlcipher jq


              Note:



              While this does extract all messages, we need to specify that "all" in signal-desktop has the meaning of "all messages actually loaded". So, in order to extract every single message, the slider of the active contact has to be slid way up, then signal-desktop will load previously not availalble messages (lather rinse repeat until satisfied). Do so as far in the past you would want your messages loaded. This gets tedious quite quickly. Remember to do so for all of your contacts' histories.



              Having that said, it is technically feasable to backup your message history, in practice it is a manual job. A way around this might be a cron job backing up all recent messages, maybe once a day. Then this is likely to contain duplicates and might miss messages in case signal-desktop has been restarted.



              In any case, this method is working fine if the (not too far -- read: a couple of months maybe) history is to be searched programmatically once in a while.






              share|improve this answer




























                0












                0








                0







                Yes, it is possible.



                Just save this in a file <yourFilename>:



                sigBase="${HOME}/.config/Signal/";
                key=$( /usr/bin/jq -r '."key"' ${sigBase}config.json );
                db="${HOME}/.config/Signal/sql/db.sqlite";
                clearTextMsgs="${sigBase}clearTextMsgs.csv";

                /usr/bin/sqlcipher -list -noheader "$db" "PRAGMA key = "x'"$key"'";select json from messages;" > "$clearTextMsgs";


                and call it via bash <yourFilename>. Or render it executable with chmod 700 <yourFilename> and call it directly: ./<yourFilename>



                This script uses sqlcipher and jq with signal-desktop's database key to open, decrypt and extract all messages in JSON format into clearTextMsgs.csv inside your signal-desktop folder ~/.config/Signal.



                Besides the key extraction by filtering JSON with jq (from ~/.config/Signal/config.json), the crucial bit happens here:



                sqlcipher -list -noheader <DB> <SQL>


                where <SQL> contains the PRAGMA key definition and the actual SQL statement (SELECT json FROM messages;).



                One can then use jq to access any key/value from the messages backup.



                Maybe you have to install sqlcipher and jq for that:



                apt install sqlcipher jq


                Note:



                While this does extract all messages, we need to specify that "all" in signal-desktop has the meaning of "all messages actually loaded". So, in order to extract every single message, the slider of the active contact has to be slid way up, then signal-desktop will load previously not availalble messages (lather rinse repeat until satisfied). Do so as far in the past you would want your messages loaded. This gets tedious quite quickly. Remember to do so for all of your contacts' histories.



                Having that said, it is technically feasable to backup your message history, in practice it is a manual job. A way around this might be a cron job backing up all recent messages, maybe once a day. Then this is likely to contain duplicates and might miss messages in case signal-desktop has been restarted.



                In any case, this method is working fine if the (not too far -- read: a couple of months maybe) history is to be searched programmatically once in a while.






                share|improve this answer















                Yes, it is possible.



                Just save this in a file <yourFilename>:



                sigBase="${HOME}/.config/Signal/";
                key=$( /usr/bin/jq -r '."key"' ${sigBase}config.json );
                db="${HOME}/.config/Signal/sql/db.sqlite";
                clearTextMsgs="${sigBase}clearTextMsgs.csv";

                /usr/bin/sqlcipher -list -noheader "$db" "PRAGMA key = "x'"$key"'";select json from messages;" > "$clearTextMsgs";


                and call it via bash <yourFilename>. Or render it executable with chmod 700 <yourFilename> and call it directly: ./<yourFilename>



                This script uses sqlcipher and jq with signal-desktop's database key to open, decrypt and extract all messages in JSON format into clearTextMsgs.csv inside your signal-desktop folder ~/.config/Signal.



                Besides the key extraction by filtering JSON with jq (from ~/.config/Signal/config.json), the crucial bit happens here:



                sqlcipher -list -noheader <DB> <SQL>


                where <SQL> contains the PRAGMA key definition and the actual SQL statement (SELECT json FROM messages;).



                One can then use jq to access any key/value from the messages backup.



                Maybe you have to install sqlcipher and jq for that:



                apt install sqlcipher jq


                Note:



                While this does extract all messages, we need to specify that "all" in signal-desktop has the meaning of "all messages actually loaded". So, in order to extract every single message, the slider of the active contact has to be slid way up, then signal-desktop will load previously not availalble messages (lather rinse repeat until satisfied). Do so as far in the past you would want your messages loaded. This gets tedious quite quickly. Remember to do so for all of your contacts' histories.



                Having that said, it is technically feasable to backup your message history, in practice it is a manual job. A way around this might be a cron job backing up all recent messages, maybe once a day. Then this is likely to contain duplicates and might miss messages in case signal-desktop has been restarted.



                In any case, this method is working fine if the (not too far -- read: a couple of months maybe) history is to be searched programmatically once in a while.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 10 at 11:28

























                answered Mar 7 at 21:18









                Gen.StackGen.Stack

                1447




                1447






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f505008%2fsignal-desktop-how-to-export-messages%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                    is 'sed' thread safe

                    How to make a Squid Proxy server?