No need to upgrade to the latest Postgres version.
We can backup and restore from any Postgres version to any as follows.
Create a backup in plain SQL format using pg_dump as follows in local/dev machine
pg_dump -U postgres -W -F p test > test.sql
Then use psql to restore dump on remote machine
psql -U postgres -W -d test -f test.sql
It works, on windows as well as Linux environments.
Please note if you see an error message while restoring on the remote machine like 'ERROR: unrecognized configuration parameter "default_table_access_method"'. You can simply ignore this message, as "default_table_access_method" option is introduced in Postgres 12 and while taking backedup added in sql file.