Hey everyone. Right now I’m using a cloud vps provider that is “unmanaged”… the good news is they are cheap. The bad news is they basically only offer bare vps and dedis w/o any tools for backups, snapshots, external firewalls, etc. etc. The provider is RackNerd.
Anyway, i’m trying to move data from one vps to another vps, both at RackNerd and don’t know how to do it. Does anyone know of any tutorials on this?
As a bonus, if you know how I can set up routine or on demand backups from the cloud vps’s to my home Truenas, that would be cool too.
I’m going to assume you can interact with these servers over ssh. The tool you’re most likely going to want to use (I’m assuming these aren’t ZFS pools) is rsync which will be able to copy files from one host to another via ssh. The command would look something like:
That uses the a flag (archive) to keep permissions and other metadata intact; v is for verbose mode, which lets you see which files are being processed; z tells it to use compression; and h uses human-readable units instead of raw bytes.
You may want to use a tmux or screen session if there’s a lot of data, so you don’t have to stay connected while the job is in progress. Also, if you’re using databases on your server, I’d do a dump to a backup file before running rsync. That way you won’t need to worry about changes to the DB during the sync.
Edit: You can do this same kind of thing from your VPS to TrueNAS. My preference is to have the backup server pull files rather than have the main server push them. Since you’d be doing this over the internet, it would be a benefit if you could use ZFS, which would let you use zfs send/recv instead of rsync.
yes, you are correct. I am using ssh. I currently have root login via ssh turned off and password login turned off (requiring a key), but I can temporarily flip those to allow root/password login on the destination vps.
I assume once I use the command you show, it’ll ask for my root password?
I’ll take a look and see if I can use zfs on RackNerd, since they only have preconfigured isos that they flash. Maybe they have an option I don’t know about.
Excellent. Instead of turning on password with for root, you could use your same public key. From the VPS, do sudo cp /home/youruser/.ssh/authorized_keys /root/.ssh/ and then sudo chown root:root /root/.ssh/authorized_keys. Then you should have the same security to login as root.