Updating Evennia¶
When Evennia is updated to a new version you will usually see it announced in the Discussion forum and in the dev blog. You can also see the changes on github or through one of our other linked pages.
If you installed with pip
¶
If you followed the normal install instructions, here’s what you do to upgrade:
Read the changelog to see what changed and if it means you need to make any changes to your game code.
If you use a virtualenv, make sure it’s active.
cd
to your game dir (e.g.mygame
)evennia stop
pip install --upgrade evennia
cd
to your game direvennia migrate
- this is safe to do, but can be skipped unless the release announcement/changelog specifically tells you to do so. Ignore any warnings about runningmakemigrations
, it should not be done!evennia start
If you installed with git
¶
This applies if you followed the git-install instructions. Before Evennia 1.0, this was the only way to install Evennia.
At any time, development is either happening in the main
branch (latest stable) or develop
(experimental). Which one is active and ‘latest’ at a given time depends - after a release, main
will see most updates, close to a new release, develop
will usually be the fastest changing.
Read the changelog to see what changed and if it means you need to make any changes to your game code.
If you use a virtualenv, make sure it’s active.
cd
to your game dir (e.g.mygame
)evennia stop
cd
to theevennia
repo folder you cloned during the git installation process.git pull
pip install --upgrade -e .
(remember the.
at the end!)cd
back to your game direvennia migrate
- this is safe to do, but can be skipped unless the release announcement/changelog specifically tells you to do so. Ignore any warnings about runningmakemigrations
, it should not be done!evennia start
If you installed with docker
¶
If you followed the docker installation instructions, you need to pull the latest docker image for the branch you want:
docker pull evennia/evennia
(main
branch)docker pull evennia/evennia:develop
(experimentaldevelop
branch)
Then restart your containers.
Resetting your database¶
Should you ever want to start over completely from scratch, there is no need to re-download Evennia. You just need to clear your database.
First:
cd
to your game dir (e.g.mygame
)evennia stop
SQLite3 (default)¶
delete the file
mygame/server/evennia.db3
evennia migrate
evennia start
PostgreSQL¶
evennia dbshell
(opens the psql client interface)psql> DROP DATABASE evennia; psql> exit
You should now follow the PostgreSQL install instructions to create a new evennia database.
evennia migrate
evennia start
MySQL/MariaDB¶
evennia dbshell
(opens the mysql client interface)mysql> DROP DATABASE evennia; mysql> exit
You should now follow the MySQL install instructions to create a new evennia database.
evennia migrate
evennia start
What are database migrations?¶
If and when an Evennia update modifies the database schema (that is, the under-the-hood details as to how data is stored in the database), you must update your existing database correspondingly to match the change. If you don’t, the updated Evennia will complain that it cannot read the database properly. Whereas schema changes should become more and more rare as Evennia matures, it may still happen from time to time.
One way one could handle this is to apply the changes manually to your database using the database’s command line. This often means adding/removing new tables or fields as well as possibly convert existing data to match what the new Evennia version expects. It should be quite obvious that this quickly becomes cumbersome and error-prone. If your database doesn’t contain anything critical yet it’s probably easiest to simply reset it and start over rather than to bother converting.
Enter migrations. Migrations keeps track of changes in the database schema and applies them automatically for you. Basically, whenever the schema changes we distribute small files called “migrations” with the source. Those tell the system exactly how to implement the change so you don’t have to do so manually. When a migration has been added we will tell you so on Evennia’s mailing lists and in commit messages - you then just run evennia migrate
to be up-to-date again.