How to convert existing data to PostgreSQL on Heroku

Hello everybody

I have built Botpress chatbot locally and it is working totally fine, now I started deploying it on Heroku
and it works totally fine too but as you know on Heroku file system, files can not be changed, so I changed database to PostgreSQL and now if I create a new bot it will work fine but how can I convert existing data to PostgreSQL or (Sqlite bot to PostgreSQL) because I added a lot of data there.

thanks

come on guys, no one knows about this?

Hi @alquhait,

Welcome to the Botpress Community!

You might want to describe a little more what you are trying to achieve here. Did you create a bot locally that you want to upload to the existing Heroku setup, or are you looking to transfer some other data? For the former, simply exporting the bot and importing in the cloud instance will do.

Let us know what your actual issue is!

Happy building :robot:

1 Like

Hi @Maxime_Joannette

I did create bot locally and fill it with QA and flows using sqlite and exported it, then I imported that bot to Heroku which uses PostgreSQL but unfortunately it always crashes, maybe because some images which was uploaded to files when it was in local then I changed BPFS_STORAGE to database on Heroku.

Thanks

When you export a bot, the media folder is included, so if you import that bot on another environment that is connected to a database, media files should upload to the database normally.

Do you have any error logged when you import the bot? That might give us some further insight on the crash’s cause, please share it with us.

If you figure it out by yourself, feel free to let us know too!

Regards,
Maxime

1 Like

Hi @Maxime_Joannette

I did the follow, I create new Heroku app then I changed database to PostgreSQL then imported bot which I exported before then I open log and this is was the output:

Couldn't reach the Duckling server , so it will be disabled.
                        For more information (or if you want to self-host it), please check the docs at
                        https://botpress.com/docs/build/nlu/#system-entities
                         [Error, operation timed out after 13 ms, 1 tries with error: connect ECONNREFUSED 127.0.0.1:8000]
STACK TRACE
Error: operation timed out after 13 ms, 1 tries with error: connect ECONNREFUSED 127.0.0.1:8000
    at /botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird-retry/lib/bluebird-retry.js:109:35
    at tryCatcher (/botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/util.js:16:23)
    at /botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/catch_filter.js:24:41
    at tryCatcher (/botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/promise.js:725:18)
    at _drainQueueStep (/botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/botpress/modules/.cache/module__1a1e7ac1a759dc886df33bf6127f3f481d1e6a97406dea60c27555c672d96aa7/node_production_modules/bluebird/js/release/async.js:15:14)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
    at process.topLevelDomainCallback (domain.js:121:23)

then I tried to open bot but it logged out then I logged in but it showed me this message:

Botpress

No access

Sorry, you do not have access to any workspace.

extra information
Botpress docker image with version 12.9.1

Thanks