Upgreade major version with full backup and restore?

blind0ne

Well-Known Member

Reaction score: 37
Messages: 256

Hello, I'm currently using freeBSD 12.2 or something like that. There are few services running on. The question is such - how can I backup the whole system and upgrade it to 13.x latest releese and how to rollback to stable state in the case if I'll face failure. The only Idea that I have on my mind is to make the image of my hard drive from another machine and than to start upgrading,but I belive that there is more efficient way to do such backups/rollbacks on the fly without physica linteraction with my hdd. I've done some kind of such things on Google cloud platform, there I can do hot image of my current running system, and backup from this one. How can I achive something like that on my vare metal machine running freebsd.
 

Zirias

Son of Beastie

Reaction score: 1,986
Messages: 3,310

If you installed on ZFS, you have a much better mechanism (with full rollback) already builtin: boot environments.
 

Zirias

Son of Beastie

Reaction score: 1,986
Messages: 3,310

There was some work done to provide boot environments with UFS, too, and I think it works, although it's less efficient than with ZFS. BUT it needs a specific partitioning scheme, so it would only be an option for you if you have unpartitioned space left. Short of that, I don't see much other possibilities than a full image/backup, but maybe somebody else would have an idea.
 

mer

Aspiring Daemon

Reaction score: 628
Messages: 983

I agree with everyone that "if ZFS...", but without knowing your current hardware setup, it's hard to give good specific advice.
But:
If a desktop and empty drive slots and the means to do so, I would pick up a new drive and install on that.
I've done that a few times and it works pretty well.
Install new drive (time to upgrade to an SSD), unplug existing boot drive, install to new drive using ZFS, do enough config to get up and running and verify it's all working, make sure you reboot off the new install a couple times, then power down, plug in old drive, boot off new drive, temp mount old drive and selectively pull off what you need.
It's a bit more work, but you wind up with a clean system, gives you the chance to clean up a bit.
 
OP
blind0ne

blind0ne

Well-Known Member

Reaction score: 37
Messages: 256

I agree with everyone that "if ZFS...", but without knowing your current hardware setup, it's hard to give good specific advice.
But:
If a desktop and empty drive slots and the means to do so, I would pick up a new drive and install on that.
I've done that a few times and it works pretty well.
Install new drive (time to upgrade to an SSD), unplug existing boot drive, install to new drive using ZFS, do enough config to get up and running and verify it's all working, make sure you reboot off the new install a couple times, then power down, plug in old drive, boot off new drive, temp mount old drive and selectively pull off what you need.
It's a bit more work, but you wind up with a clean system, gives you the chance to clean up a bit.
Is there are some scripts to change from UFS to ZFS? I don't have any other drives except my destop pc drive with backup data on it
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,918
Messages: 40,667

Is there are some scripts to change from UFS to ZFS?
It's not possible to "convert" from UFS to ZFS.

In any case, backup your data not the OS or the software you installed. Those are all easily installed again (you do want to backup some of their configuration files), it's your data that's important and that cannot be reinstalled.
 
  • Like
Reactions: mer
OP
blind0ne

blind0ne

Well-Known Member

Reaction score: 37
Messages: 256

So what is the way to backup running system and make snapshot from it if I'm using UFS? Isit possible?
 

Argentum

Aspiring Daemon

Reaction score: 320
Messages: 663

So what is the way to backup running system and make snapshot from it if I'm using UFS? Isit possible?
Did I understand correctly that this is your desktop system with just one drive? If so, I recommend to find one more drive and back up the whole thing. Then make a fresh install (on ZFS) and import your data from backup.
To back up the drive, one option is to boot from USB stick and copy the whole drive with dd. (dd(1))
 
Top