< 1 minute read

Let us see how to upgrade Botpress bot to the latest Botpress version.

Follow below steps.

  1. Export bot from old version in admin page (This would create a bot_<botid>_<timestamp>.tgz file) and import in the new version by providing bot id and the import file.
  2. Download latest botpress binary from official site.
  3. Copy existing bot folder from your older workspace to new one
    a. botpress-master\out\bp\data\bots to botpress\data\bots
  4. Add bot id to botpress\data\global\workspaces.json
    a. Eg: “bots”: [“infaa1”],
  5. Copy your custom module
    a. Eg: botpress-master\modules\infa-module to botpress\modules\infa-module
  6. Enable your custom module in C:\Tools\botpress\data\global\botpress.config.json file
{
	  "location": "MODULES_ROOT/infa-module",
	  "enabled": true
}
  1. Copy custom css to botpress\data\assets\modules\channel-web\infa-style.css
  2. Restart botpress
  3. Enable this bot as an embedded bot inside your website. Eg: In your index.html add below 2 script tags
<head>
	<script src="http://host:port/assets/modules/channel-web/inject.js"></script>
</head>
<script>
	  window.botpressWebChat.init({
		host: 'http://host:port',
		botId: 'infaa1',
		overrides: {
		  before_container: [{
			module: 'infa-module',
			component: 'InfaMessageController'
		  }]
		},
		extraStylesheet: 'http://host:port/assets/modules/channel-web/assets/infa-style.css'
	  })
</script>

Note: Above steps assume you have a custom stylesheet and you need to embed in an existing website.


Simon

I am a Fullstack developer and Consultant with an experience of 9+ years in the industry. I mainly work on Java, React, Javascript, NodeJs, Elasticsearch and Botpress.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.