Access /home/user-data via Filezilla

As my Linux is a bit rusty please allow me a silly question.

I am about to perform a long-overdue upgrade from V57a / 18.04 to V71 / 22.04. So I need to make a backup first and get these files off the current instance and then back onto the new instance, via a (Windows) PC.

I run into the problem that when I use Filezilla (keyfile login) I am only able to log in as user ubuntu. And this user does not have access to /home/user-data. Using Putty one would sudo up and get access but that is (afaics) impossible in SFTP.

My question, is the best way to move the backup files to and from a directory that user ubuntu can touch, or are there currently better ways to move these files to and from a PC to a MIAB instance?

I personally use the pre-installed webmin. It allows me to easily pack and download data.

This seems like a limitation of your software, Filezilla.

Why not SSH in and copy/move the files to a directory that the user ubuntu can access?

Or even better, why not rsync directly to the new VPS rather than download and upload to/from your PC?

Windows does have a terminal these days, no?

I’m not creating a new VPS as a new VPS means a new IP address, which I try to prevent. So the idea is to backup MIAB v57A, copy the BU data to my PC, enlarge the VPS a bit as I need a bit more disk space, spin up Ubuntu 22.04, install MIAB v71 and copy the BU data from my PC to this new instance.

Go ahead and do that.
Before sudo chmod -R 755 /home/userdata/mailboxex/>>yourmailbox
Or chmod 775

Don’t forget to change back to 700 when you copy back to upgraded instance.
Please report if the new MIAB webmail reads the mailbox properly.

Make a note of all your settings including custom dns entries, users and aliases before proceeding and recreate them in the upgraded instance.
Do reserve the IP address depending on your VPS provider.

Who is your VPS provider? With many there is a simpler way.

If your provider supports taking snapshots, AND supports restoring a snapshot as the original OS on a vps, then you could … spin up a Ubuntu 22 vps. Migrate to it. Then create a snapshot of the new VPS. Restore that snapshot to the original VPS after you resize it.

This might be a fair bit simpler… since you do not need to do the whole upload/download routine from vps1 to home to vps2. You can simply rsync the backup from vps1 to the new one, restore it, then snapshot …

Just a thought.

That is a very interesting idea as this would simplify the move (and allow me to toy with the new instance without wrecking the old one first). TransIP does offer snapshots; I’ll find out if these are bound to a certain VPS or that I can freely use the snapshot of one on another VPS.

Thanks for the suggestion!

You could temporarily enable the root account and configure sshd to allow login as root:

Enable the root account

sudo passwd root

Open the SSH configuration file…

sudo nano /etc/ssh/sshd_config

…and modify the PermitRootLogin Directive

PermitRootLogin yes

Restart the SSH Service

sudo systemctl restart sshd

If you’re finished, undo the changes in sshd_config, and disable the root account again

sudo passwd -d root
1 Like