How to archive the chatroom after a certain period of inactivity

In Openfire if a chatroom is inactive for some period ,how we can do auto archiving the chatroom and load only chatrooms which are not archived.

OF only loads mucrooms which are used within a specific time.
You can configure git here (OF 4.6.4):
Admin console > Groupchat > Chatservices and look for Memory Management

@totzkotz is there any feature like archiving in openfire for chatrooms, I am using strophejs for xmpp communication using which I am loading chat-rooms related to a user. So, now it is displaying all chat-rooms, whether by using the above configuration can we load only non-archived chat-rooms(which are idle for x days).

And also how can we force a chatroom to be archived when user wants it to be achieved.

Normaly you will only see public MUCs which are loaded by OF.
But an explicit archiving function is not implemented. btw what do you mean “to archive”?
Conversations are saved to database by XEP-0313.

no I am talking about chatroom archive.