Lxd-p2c --rsync-args --exclude not working

I think I’m missing something on how to use rsync exclude with lxd-p2c. I’ve tried numerous permutations, and while the verbose flag works, the --exclude just gets ignored.

Both my LXD host and the server I am trying to migrate are running rsync 3.1.3. The server I’m trying to migrate was running 3.1.2 before and I thought that might have been the issue so I upgraded it.

My lxd2pc command looks like:

./lxd-p2c https://mylxdhost:8443 mycontainer / --rsync-args="-vv --exclude '/var/cache' --exclude '/var/log' --exclude '/usr/share/nginx/logs' --exclude '/usr/share/nginx/old-media' --exclude '/usr/share/nginx/media' " --storage=lxd2

I’m running lxd-p2c version 4.7 and my lxd host is a lxd snap install now on version 4.8

I finally got this to work. After many permutations, it seemed it wouldn’t work if -vv was in front.

So I ended up with a command:

./lxd-p2c https://mylxdhost:8443 mycontainer  /  --storage=lxd2 --rsync-args="--exclude=usr/share/nginx/ --exclude=proc/ --exclude=sys/ --exclude=tmp/  --exclude=home/ --exclude=root/ --exclude=var/log/ --exclude=dev/ --exclude=.cache/ --exclude=var/lib/pgsql/9.6/data/ --exclude=var/opt/mssql/log/ --exclude=var/spool/postfix/maildrop/ --exclude=var/opt/mssql/ --exclude=/run/ --exclude=/sys/ --exclude=/boot/ --ignore-errors  -vv  "

The --ignore-errors didn’t seem to work as it would break on things like /sys/ so would have to exclude that as well, but at least the exclude worked which is what I needed to exclude 1 TB of unneeded data.

I assume it doesn’t make a difference to server I was converting but it was a CentOS 7.5 and my LXD Host is Ubuntu 20.04.