# Upgrading to major versions: example 12.2 to 13



## dalpets (Apr 4, 2021)

Is there a way to go from my present 12.2 to, say, a major version such as 13, perhaps, by a not entirely standard upgrade methodology, but rather one that would avoid the potential occurrence of errors, indeed one that has the most chance of success . For me, at this early stage of my journey, it would be a heartbreaking exercise to have to go back to scratch & reinstall. I'm sort of paranoid about that happening.

And, could continuity be served by integrating a backup of suitable files from 12.2 to 13 in this example?


----------



## SirDice (Apr 4, 2021)

dalpets said:


> but rather one that would avoid the potential occurrence of errors


Any upgrade will have a certain amount of risk. Regardless of the process. Remember Mythbusters? Failure is always an option. 



dalpets said:


> For me, at this early stage of my journey, it would be a heartbreaking exercise to have to go back to scratch & reinstall. I'm sort of paranoid about that happening.


One word: backup.


----------



## zirias@ (Apr 4, 2021)

I'd bring boot environments to the table, _if_ you're on ZFS. Unless you do something irreversible (like, upgrading your pool or datasets), you can always go back with boot environments.


----------



## tingo (Apr 5, 2021)

if possible, always keep a "test machine" available. A "test machine" is another machine that you run FreeBSD on, and can use to test upgrades, installing new software and so on. Time-consuming, but lowers the risk of unwanted changes or complications surprising you when time comes to upgrade your real FreeBSD machine.


----------



## dalpets (Apr 5, 2021)

tingo said:


> if possible, always keep a "test machine" available. A "test machine" is another machine that you run FreeBSD on, and can use to test upgrades, installing new software and so on. Time-consuming, but lowers the risk of unwanted changes or complications surprising you when time comes to upgrade your real FreeBSD machine.


I like that approach


----------



## dalpets (Apr 5, 2021)

Zirias said:


> I'd bring boot environments to the table, _if_ you're on ZFS. Unless you do something irreversible (like, upgrading your pool or datasets), you can always go back with boot environments.


I'd be interested in doing that, together with Tingo's test machine approach.


----------



## dalpets (Apr 5, 2021)

Are poudriere or synth realistic options for upgrades?


----------



## dalpets (Apr 5, 2021)

Zirias said:


> I'd bring boot environments to the table, _if_ you're on ZFS. Unless you do something irreversible (like, upgrading your pool or datasets), you can always go back with boot environments.


Is there a resource where I could educate myself on ZFS boot environments in a relatively easy assimilable way for a newcomer to fbsd? I find more than a small amount of the fbsd documentation unfriendly & cryptic, so some alternative  type tutorials would probably be more helpful, if they exist, for me at this early stage of my development.


----------



## dalpets (Apr 5, 2021)

What is the procedure to wind back any version of the OS? Are there prerequisites for that to happen, as in Windows?


----------



## mtu (Apr 5, 2021)

dalpets said:


> What is the procedure to wind back any version of the OS? Are there prerequisites for that to happen, as in Windows?


This discussion comes close to what you might call "best practice":








						bectl & upgrade with full rollback ability
					

Hi  I'd like to figure out how to do an upgrade with the ability to rollback fully if anything goes wrong. Taking into account the info from the following topics:  https://forums.freebsd.org/threads/what-is-the-proper-way-to-take-snapshots-and-do-rollbacks-of-zroot.61297/...




					forums.freebsd.org


----------



## mtu (Apr 5, 2021)

dalpets said:


> Are poudriere or synth realistic options for upgrades?


Probably not in the way you're thinking, because poudriere and synth are meant to deal with ports/packages.

The upgrade from 12.2 to 13.0 is a matter of the *base system*, and is (to a good approximation) completely independent of the installed ports/packages.


----------



## ShelLuser (Apr 5, 2021)

dalpets said:


> Is there a way to go from my present 12.2 to, say, a major version such as 13, perhaps, by a not entirely standard upgrade methodology, but rather one that would avoid the potential occurrence of errors,


As cliché as this may sound but such problems aren't only caused by the upgrade process but also the current state of your system. 

If you ignore all general aspects of proper systems administration then you'll run into problems no matter how you upgrade.


----------



## dalpets (Apr 5, 2021)

ShelLuser said:


> As cliché as this may sound but such problems aren't only caused by the upgrade process but also the current state of your system.
> 
> If you ignore all general aspects of proper systems administration then you'll run into problems no matter how you upgrade.


I most definitely understand.
Would you care to give me some specific tips towards a viable system state?
The only ones I'm aware of at this juncture is the need to update security patches & to be especially vigilent in entertaining pf files.


----------



## scottro (Apr 5, 2021)

I think this is a good explanation of using beadm or bectl. (I believe they use the same commands.)



			FreeBSD and beadm – Michael W Lucas


----------



## obsigna (Apr 5, 2021)

FreeBSD 12.0 has been released - an update log
					






					obsigna.com
				



Mainly for myself, I wrote this up more than two years ago, and I will follow the exact steps on the coming weekend with FreeBSD 13.0-RELEASE on a handful of systems. I don’t expect major difficulties. One of my servers was installed in 2009 with FreeBSD 8.x and it is now on FreeBSD 12.2 and will soon be on FreeBSD 13.0, and that all the way up by using freebsd-update(8) for major, minor and patch-level upgrades/updates. There were some glitches, but not a single show stopper.









						Chapter 25. Updating and Upgrading FreeBSD
					

Information about how to keep a FreeBSD system up-to-date with freebsd-update or Git, how to rebuild and reinstall the entire base system, etc




					docs.freebsd.org
				




Someone who is able to follow step-by-step instructions without deviations won’t have big problems. Those who launch public opinion polls on each step in order to pull over the inconvenient ones, would take a tad longer to reach the objective, if reaching it at all.


----------



## grahamperrin@ (Apr 20, 2021)

scottro said:


> … beadm or bectl. (I believe they use the same commands.)



Much the same.

There's talk of making *recursion* a default when using bectl(8) to create an environment, which might cause it to differ from the default behaviour with beadm(8) (beadm(1) pending a fix for FreeBSD bug 254466).



mtu said:


> … close to what you might call "best practice": …



Re: <https://forums.FreeBSD.org/threads/bectl-upgrade-with-full-rollback-ability.79532/post-507365> I shouldn't treat the chroot approach, which is understandably popular, as best practice. 

That aside, there are some good hints in the topic.


----------



## scottro (Apr 20, 2021)

Also, I'd suggest following SirDice's advice in this post. https://forums.freebsd.org/threads/freebsd-13-annoyances.79815/post-507381

It differs from the official documentation, but is a better method, in my humble opinion.


----------

