# User Chat History Logs in Rocketchat Server

**URL:** <https://forums.rocket.chat/t/user-chat-history-logs-in-rocketchat-server/12257>\
**Category:** Community Support\
**Created:** [September 22, 2021, 11:08am UTC](https://forums.rocket.chat/t/user-chat-history-logs-in-rocketchat-server/12257 "2021-09-22T11:08:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PremKishan](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@PremKishan](https://forums.rocket.chat/u/PremKishan)\
**Post date:** [September 22, 2021, 11:08am UTC](https://forums.rocket.chat/t/user-chat-history-logs-in-rocketchat-server/12257/1 "2021-09-22T11:08:23Z")

</div>

Hello Everyone!!

I have been using [Rocket.Chat](http://rocket.chat/) tool for a while. I am about to deploy the tool into the production environment. Can someone please let me know how do I retrieve the user chat history logs using the terminal. I use Ubuntu 18.04 OS. Is there any command or tool to retrieve the chat history logs which is stored in the [Rocket.chat](http://rocket.chat/)server. Any help will be beneficial.

Thanks!!

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [September 22, 2021, 1:40pm UTC](https://forums.rocket.chat/t/user-chat-history-logs-in-rocketchat-server/12257/2 "2021-09-22T13:40:47Z")

</div>

Hi!

What logs are you talking about? Also, what are you planning to do? do backup and restore?

You can probably get those information using REST API or directly accessing the Database.

---

<div class="post-metadata">

**Author:** ![PremKishan](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@PremKishan](https://forums.rocket.chat/u/PremKishan)\
**Post date:** [September 23, 2021, 4:50am UTC](https://forums.rocket.chat/t/user-chat-history-logs-in-rocketchat-server/12257/3 "2021-09-23T04:50:21Z")

</div>

Hi!!

Yeah I am about to backup the user chats which is stored in the Rocket.Chat Server. I am unable to retrieve the user chats either via the terminal or the GUI. Can you please help me out to retrieve the chat logs in Rocket Chat Server via the terminal. As you mentioned, How do I access the database? Is there any specific command to directly access the Database? I use Ubuntu 18.04 OS.

Thanks!

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [September 23, 2021, 10:15am UTC](https://forums.rocket.chat/t/user-chat-history-logs-in-rocketchat-server/12257/4 "2021-09-23T10:15:53Z")

</div>

Well, we first need to know how you deployed and at what version you are running it right now.

Based on that, you can issue some commands, thru CLI or even use some graphical softwares to extract the information you want.

You want to **dump** your database, and **restore** it into the production environment you have.

If your deployment was done with docker (which I recommend), please check this post about how to properly dump and restore it:

> [@\[HOW TO\] Docker backup mongo](https://forums.rocket.chat/t/how-to-docker-backup-mongo/11155):
>
> This question is asked frequently. How do I backup and restore a mongo DB in a docker container. We first need to find the container label. You may need sudo for the following commands. docker ps -a NAMES docker\_mongo\_1 So we need to do this: docker exec docker\_mongo\_1 sh -c 'mongodump --archive' \> db.dump And in the current directory you should find db.dump Restore should be the reverse process: docker exec -i docker\_mongo\_1 sh -c 'mongorestore --archive' \< db.dump This is quite a go…

---

<div class="post-metadata">

**Author:** ![PremKishan](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@PremKishan](https://forums.rocket.chat/u/PremKishan)\
**Post date:** [September 23, 2021, 10:27am UTC](https://forums.rocket.chat/t/user-chat-history-logs-in-rocketchat-server/12257/5 "2021-09-23T10:27:06Z")

</div>

Hi!

I have installed Rocket Chat in my system using the below URL

> **[Rocket.Chat in Ubuntu](https://docs.rocket.chat/installing-and-updating/manual-installation/ubuntu)**

My Rocket Chat Version is 3.18.0. I kindly request you to let me know if there are any commands to retrieve the user chats stored in Rocket Chat Server via terminal. I haven’t installed Rocket Chat through docker.

Thanks!

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [September 23, 2021, 1:19pm UTC](https://forums.rocket.chat/t/user-chat-history-logs-in-rocketchat-server/12257/6 "2021-09-23T13:19:23Z")

</div>

Ok, great!

You can probably use some mongo graphical software (Like [Compass | MongoDB](https://www.mongodb.com/products/compass)) to do it using a graphical user interface.

or you can dump using **mongodump** , considering it is installed:

> **[Back Up and Restore with MongoDB Tools — MongoDB Manual](https://docs.mongodb.com/manual/tutorial/backup-and-restore-tools/)**

just issuing **mongodump** should be able to dump. For more options (like specifying output folder, etc), please, check the docs above.
