Best way to backup PostgreSQL cluster before upgrade
AFAIK, the several ways to backup my cluster is : pg_dumpall, pg_basebackupp or tar.


Also, filesystem instantaneous snapshots if your filesystem/OS has this feature.

For small/medium databases it's probably OK to use any of these methods.

Choose the method which you feel most comfortable with.

With tar/cp backups remember to shutdown cluster before doing the backup.

Logical backups (pg_dump + pg_dumpall) have extra advantage of being portable (to other Pg versions). But the restore is a multi-step process, with Fs/directory it's just a plain replacement of contents.


  I tested pg_dumpall and pg_basebackup but I've seen that after doing
  an upgrade and restore, the size and files of PGDATA did changed (like
  WAL folder for example). Is it normal 


Yes, completely normal. I mean - if the difference is 100-fold then probably something fishy is going on, but it's normal that after dump/restore the on-disk size is smaller.