Brand new to Kopia. Need advice re: multuple repositories

Before I go all-in on Kopia, let me describe what I’m trying to do.

I’m coming from Windows 10, moving to Ubuntu Linux. In Windows I had Macrium Reflect backing up two SSDs – separately – to a single external USB-connected hard-drive. The two separate backups were stored in two different folders on the external USB drive.

Can Kopia do this?

I plan to have the OS and most apps installed on a 1TB SSD and all my user files (and some games and a few other apps) on a 4TB SSD, and I’d like very much to backup those two drives separately. The 1TB drive will be the root folder (and /usr and /bin and /etc and the like), while the 4TB drive will contain my /home folder only.

So that means two separate repositories on a single external USB drive (it’s a 22TB Seagate Ironwolf HDD in a separately-powered enclosure, not some silly thumb-drive, in case that’s what you were imagining). And I want them both to be backed up automatically – in Macrium on Windows I had it set up to backup the 1TB drive at 1AM every night, and the 4TB drive at 4AM every night.

Can I do all this with KopiaUI? If so, can you tell me what I’d need to do to set that up?

What are you hoping to gain with going with two separate repos, when both if them are located on the same physical storage?

Leaving the above question aside - you can create as many repos on a physical storage as you wish and also run different backups on them. All you need to do is to connect/disconnect to the resp. repo before running the kopia snapshot.

So there’s no way to do it automatically? I have to manually disconnect from one to back up to the other?

I have my root (and all the other OS folders) one one drive, and my /home on another drive. I’d hoped to keep the backups separate as well.

You’re running Linux, so its easy to automate that. I am always connecting to the repo, just before I start the snapshot and disconnect afterwards. The only thing not possible is to run the two snapshots at the same time.

Just keep in mind, that “connecting” to a repo doesn’t actually mean, that there’s an actual persistent network connection established. It only pepares some config files which allow kopia to operate without you needing it to feed the repo information for every command.

Like @budy says, you will need two individual repos.

A Kopia repository on local disk is just a directory where the backup data and its configuration is stored, so all you need is two directories in the same backup media, one for each repository. That means running kopia repository create twice to create both of them in different paths.

This might not seem intuitive because by default Kopia uses one single config file at ~/.config/kopia/repository.config, but you can run the kopia cli telling it to use another config file that points to another repo.

Dealing with multiple repositories at once means you need to keep multiple Kopia configurations.

You can use –config-file on every command or the env variable KOPIA_CONFIG_PATH.

export KOPIA_CONFIG_PATH=/path/to/repo1.config
export KOPIA_PASSWORD=mysecret
kopia repository create filesystem --path=/path/to/repo1-data

export KOPIA_CONFIG_PATH=/path/to/repo2.config
export KOPIA_PASSWORD=mysecret
kopia repository create filesystem --path=/path/to/repo2-data

You can have two backup scripts that use different configs, each one points to its own repo.

export KOPIA_CONFIG_PATH=/path/to/repo1.config
export KOPIA_PASSWORD=mysecret
kopia snapshot create /
export KOPIA_CONFIG_PATH=/path/to/repo2.config
export KOPIA_PASSWORD=mysecret
kopia snapshot create /home

You will also create /.kopiaignore (at the root directory of the system) with the contents

/home

That’ll make the first system backup ignore the /home directory.

===============

Now, personally, I have been doing backups to the same repo, but not of the entire system, starting at the root (/). Over the years, I found that if my OS needs a fresh install, it’s best to start new and reinstall from scratch.

I have been keeping backups of the following directories in the same repo:

/etc
/root
/home

Since it’s a debian based distro, I’m using apt-clone to dump all installed packages into /root before running the backup. You can probably find an alternative for any other distro out there that dumps a list of all installed packages.

That is enough information for me to restore the same state I had before with a few steps. If I want to move to another distro, /etc is the only directory I cannot restore directly and just use it as a template to copy anything I need.

1 Like

Oh, yeah – no, I wasn’t going to try to run them both simultaneously. The way I had it set up when I ran Windows was, my smaller drive went first at 1AM and then the bigger one later at 4AM. Kept them from conflicting with each other.

Ok – so I have to do it via a script, not via the GUI. That’s where my confusion lay – I couldn’t figure out how to make the GUI do it…

I guess I just write a couple of scripts and put them in cron, then?

Yes, that’s how it is usually done.