Update Existing Installation
Updating a local installation of the ErbslandFORMER application requires a few straightforward steps. Follow the instructions below to ensure a smooth update process.
Stop the Apache Web Server
Connect to the server and stop the Apache web server.
test@erbsland-former:~$ sudo systemctl stop apache2
Switch to the Application User and Navigate to the Application Directory
Change to the application user and set the current directory to the application directory.
test@erbsland-former:~$ sudo su erbsland_former erbsland_former@erbsland-former:/home/test$ cd /var/www/erbsland-former/app/ erbsland_former@erbsland-former:/var/www/erbsland-former/app$ █
Activate the Python Virtual Environment
Activate the Python virtual environment.
$ source /var/www/erbsland-former/venv/bin/activate $ █
Stash Any Local Changes
If there are any local changes, make sure to stash them.
$ git stash Saved working directory and index state WIP on main: 7c66a87 Preparation for release version. $ █
Pull the Latest Version of the Application
Pull the latest version of the application from the repository.
$ git pull Updating a1d1368..7c66a87 Fast-forward (...) $ █
Reapply Stashed Changes (If Any)
If you have stashed any changes, re-apply them and remove the stash.
$ git stash pop (...) $ █
Set the Environment Variable for Custom Settings
Set the environment variable for your custom settings module.
$ export DJANGO_SETTINGS_MODULE=ErbslandFormer.my_settings $ █
Update Static Files
Update the static files. In most cases, nothing will change.
$ python manage.py collectstatic You have requested to collect static files at the destination location as specified in your settings: /var/www/erbsland-former/static This will overwrite existing files! Are you sure you want to do this? Type 'yes' to continue, or 'no' to cancel: yes 3 static files copied to '/var/www/erbsland-former/static', 186 unmodified. $ █
Migrate the Database
Migrate the database. In most cases, there are no migrations required.
$ python manage.py migrate (...) $ █
Exit the Application User Shell and Restart Apache
Exit the application user shell and restart Apache.
(venv) erbsland_former@erbsland-former:/var/www/erbsland-former/app$ exit test@erbsland-former:~$ sudo systemctl start apache2 test@erbsland-former:~$ █
You have now successfully updated your ErbslandFORMER application.