Upgrading Foreman/Katello 2.4/4.0 to 2.5/4.1

Generally, the complete upgrade procedure is in the docs: Upgrading and Updating Foreman

I would recommend to install and enable the foreman and katello repositories as well as as the required os repositories from the repo files before the upgrade and installer run. The installer occasionally wants to install additional packages and that doesn’t always work if you are using only the server itself as packages source. (of course, it’s not a disaster either as the installer would print an error and you could manually fix the problem and then rerun the installer).

The installer has all your options save in the answer file in /etc/foreman-installer/scenarios.d/ You only have to give the options if you want to change something. Compare step 10 in the upgrade docs above.