The upgrade of a Manual Install can be repurposed to create steps to upgrade a Juju install. If you have compartmentalized the services responsible for operating Landscape, this guide will walk you through upgrading an individual Landscape Server (appserver), and then more specifically provide a checklist of tasks and commands for performing a manual upgrade.
Upgrade via Appserver Replacement
This approach is very basic – simply stop the Landscape Server 19.10 stable appserver, back up the relevant files, then replace it with a Landscape Server 22.10 beta appserver with the backed-up files restored.
NOTE: for any steps below requiring domain names (such as self-signed cert and such), this guide takes the shortcut of editing /etc/hosts
on various machines so that landscape-test.lxd always pointed at the “active” Landscape Server appserver.
Setup
4 LXD containers
- landscape-app-bionic (bionic) where Landscape 19.10 stable is running
- landscape-app-focal (focal) where Landscape 22.10 beta is running
- landscape-db (focal) where PostgreSQL is running
1 LXD container that we are managing in Landscape, for demonstration purposes
- landscape-client (focal) is a machine enrolled in Landscape
Steps
-
Follow the install directions, doing the PostgreSQL setup touches landscape-db, rabbitmq, and apache, and the Landscape setup touches landscape-app-bionic.
- NOTE: in the “Configure PostgreSQL” step, this guide uses 10.76.244.0/24 as the
<IP-OF-APP>
so that any of other LXD machines used in this guide have access to it
- NOTE: in the “Configure PostgreSQL” step, this guide uses 10.76.244.0/24 as the
-
Install the landscape-client package on the landscape-client machine and register it with Landscape
-
Follow the backup directions for Landscape config files, skipping the logs and
/etc/postgresql
files -
Stop landscape-app-bionic
-
On landscape-app-focal, follow the install directions, starting at “Adding the Landscape package archive and installing the package”, only up to the end of “Configure rabbitmq”
-
Push the backed up files from step 3 to landscape-app-focal, to the appropriate (identical) locations
-
Continue following the install directions, starting at “Webserver configuration”, skip the step for creating the
sites-available
file, and proceed to the end of “Start Landscape Services” -
Update
/etc/hosts
file on landscape-client to point to the IP address of landscape-app-focal -
Confirm that client is able to ping server. Confirm that server UI is accessible via browser
Upgrade via Manual Installation
This how-to is intended to guide the user through upgrading a manual installation of Landscape Server running on Ubuntu 18.04 LTS (“bionic”) to a manual installation of Landscape Server running on Ubuntu 20.04 (“focal”) or Ubuntu 22.04 (“jammy”).
Preparing for the upgrade
What you will need:
- Ubuntu 20.04 LTS (“focal”) or 22.04 LTS (“jammy”) install media.
- A backup of all of the files in
/etc/landscape
on your current Landscape Server machine - The Server X509 certificate file and key file issued for the FQDN hostname of the application server. These should be on your current Landscape Server machine at
/etc/ssl/certs/landscape_server.pem
and/etc/ssl/private/landscape_server.key
, respectively. (If you are using a self-signed certificate, you will also need/etc/ssl/certs/landscape_server_ca.crt
) - A copy of your Landscape Server default configuration file. This should be on your current Landscape Server machine at
/etc/default/landscape-server
If your PostgreSQL installation is running on the same machine as your Landscape Server installation:
- A backup of all of the files in
/etc/postgresql/<pg-version>/main
If your Apache web server installation is running on the same machine as your Landscape Server installation:
- A copy of
/etc/apache2/sites-available/server-name
, the Landscape Apache vhost config file, usually named after the FQDN of the server
Stop Landscape Server
Stop the Landscape Server services on your existing installation to prevent changes from occurring during the migration:
sudo lsctl stop
To prevent maintenance tasks from occurring, you can also move or remove the /etc/cron.d/landscape-server
file.
Backing Up and Restoring the Database
NOTE: If your Landscape PostgreSQL database is not running on the same machine as your Landscape Server, it is very likely that you can skip this section.
-
Backup your database server using
pg_dumpall
, for example:sudo -u postgres pg_dumpall > backup.sql
-
Install PostgreSQL and required libraries on your new machine:
sudo apt install postgresql-12 python3-apt postgresql-plpython3-12 postgresql-contrib-12 postgresql-12-debversion
NOTE: If using Ubuntu 22.04, the PostgreSQL and related package versions should be at version 14
-
Replace existing files in
/etc/postgresql/<pg-version>/main
with those previously copied -
Copy the backup file from your previous installation and restore it on the new installation:
sudo -u postgres psql -f backup.sql postgres
Installing Landscape Server Beta
Landscape Beta is distributed in a public PPA.
-
Add the PPA on your target machine:
sudo add-apt-repository ppa:landscape/self-hosted-beta
-
Install the server package:
sudo apt install landscape-server
-
Replace the files in
/etc/landscape
with the ones you copied earlier from your previous Landscape installation (and ensure they are owned by the landscape user, and the root group) -
Replace
/etc/default/landscape-server
with the version you copied earlier from your previous installation (ensure it is owned by the landscape user and the root group) -
Add
/etc/ssl/certs/landscape_server.pem
,/etc/ssl/private/landscape_server.key
, and/etc/ssl/certs/landscape_server_ca.crt
as needed. Ensure that the .key is owned by the landscape user and the www-data group.
If you previously had Apache installed on the same machine as Landscape Server, perform these additional steps.
-
Install Apache:
sudo apt install apache2
-
Add the
/etc/apache2/sites-available/<server-name>
file you copied earlier from your previous installation -
Configure apache and restart it:
for module in rewrite proxy_http ssl headers expires; do sudo a2enmod $module; done sudo a2dismod status sudo a2dissite 000-default sudo a2ensite landscape.conf sudo service apache2 restart
If you previously had RabbitMQ installed on the same machine as Landscape Server, perform these additional steps.
-
Install RabbitMQ:
sudo apt install rabbitmq-server
-
set up the new installation using a password of your choice:
sudo rabbitmqctl add_user landscape <password> sudo rabbitmqctl add_vhost landscape sudo rabbitmqctl set_permissions -p landscape landscape ".*" ".*" ".*"
-
Edit
/etc/rabbitmq/rabbitmq-env.conf
:NODE_IP_ADDRESS=127.0.0.1
-
Restart rabbitmq-server
sudo systemctl restart rabbitmq-server
-
Update the
[broker]
section of/etc/landscape/service.conf
to use your new password
Configuring Landscape Server
Landscape Server will need to check that your database has an up-to-date schema. If it does not, it will perform a schema migration. Depending on what version of Landscape Server you are upgrading from, this may be a backwards-incompatible change. Make sure that you are able to restore your previous setup before performing this step.
On your new Landscape Server Beta installation, run the setup:
sudo setup-landscape-server
Then start the Landscape services:
sudo lsctl restart
Make sure that your Landscape installation is working satisfactorily before performing any deletions of your previous installation.