can't shrink the system partition in order to clone and swap disk I wanted to swap my 1TB old iMac HDD to a 1TB SSD but apparently it's not that easy with diskutil under mojave recovery system.
From a disk to disk it's impossible since the disc is complaining to not be Apple_HFS so I needed to point to the container partition of the system disk but then the container is complaining that there is not enough space on the destination disk (since it's an ssd I guess that the total size vary a little with an HDD). Problem is that I can't get the system partition to shrink even if there is only 170G occupied. 

Should I apply this technique or is the problem somewhere else? 
Thanks in advance for all the help.

Side question: How can I make a image of a partition of its content and not the whole block size partition ? I read that diskutility is now using a block scheme and not a file-present scheme to backup.

to be completed this is the partition scheme which I can't totally interpretate with certainty, as you can see there is a VM partition don't know why it's there nor did I tried to access it. And I guess that the disk5 is the timemachine backup at that moment.
I used CCC to clone my internal 1T hd to an external SSD. You need to format the SSD before the clone. The drives do not need to be the same size.  The data has to fit.

Carbon Copy Cloner (CCC) will copy your startup drive to an external  firewire drive.  You can boot from the external drive to verify that you have a good clone. When you upgrade your existing startup drive, you can at any time boot from your external drive and go back to your existing system.
http://www.bombich.com/software/ccc.html

Question: what about the EFI partition

Created when you initialize/format the drive.  CCC is a partition cloner not a volume cloner. 

the others partitions like recovery

There is an option to add this at the end of the clone.  If it on the source volume, you will get a prompt. I gather there is a way to clone the recovery partition manually.  It did prompt me when I clone my one partition startup drive. https://bombich.com/kb/ccc5/cloning-apples-recovery-hd-partition

or VM ? 

I don't see no VM in my distutil list.

Here is the result after I cloned Macintosh HD [ /dev/disk0 ]to Macintosh SSD [ /dev/disk4 ].  I don't know why the two are different nor do I know what will happen when I swap the internal and external drives.  I assume it will work. 'cause I heard it will.  

mac $ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:          Apple_CoreStorage                         999.3 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           *999.0 GB   disk1
                                 Logical Volume on disk0s2
                                 B...9
                                 Unencrypted

/dev/disk4
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk4
   1:                        EFI EFI                     209.7 MB   disk4s1
   2:                  Apple_HFS Macintosh SSD           999.2 GB   disk4s2
   3:                 Apple_Boot Recovery HD             784.2 MB   disk4s3


SuperDuper is the wildly acclaimed program that makes recovery painless, because it makes creating a fully bootable backup painless. Its incredibly clear, friendly interface is understandable, easy to use, and SuperDuper's built-in scheduler makes it trivial to back up automatically. And it runs beautifully on both Intel and Power PC Macs!

Give SuperDuper a workout on your own system. Clone to your heart's content — for free. See what else is possible. When you're convinced that SuperDuper is a terrific solution — and a great value at $27.95 — you can register right from the application and start using its advanced features immediately!

http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html