fred4jupiter / fredbet

Simple football betting application using Spring Boot, Thymeleaf and Bootstrap. Well prepared for betting with friends.
MIT License
119 stars 63 forks source link

change spring.profiles.active during runtime #16

Closed YoSev closed 5 years ago

YoSev commented 5 years ago

Hello,

we are using fredbet quite heavily but we began in dev mode - now we are afraid, that a restart of the host etc. will make us loose all data.

Is it possible to backup/restore the h2 database from time to time or change to production on the fly?

thanks

fred4jupiter commented 5 years ago

Hi, the H2 database is for development only. And the dev profile also. In production you have to use a production-grade database, e.g. PostgreSQL, MySQL or the like. In the runtime configuration there is a menu entry about backing up the h2 database. But this is more experimental. The dev profile runs in memory only. After restart all data will be lost. But this is intented. The active profiles will be determined at startup. Therefore the profile cannot be changed at runtime.

YoSev commented 5 years ago

Hi,

i expected that answer - thanks a lot! And sorry for abusing the issue board.

Cheers, John