Upgrading Postgres 12 to 13: 'pg_upgrade.exe' fails I'm attempting to upgrade a Postgres instance from version 12 to version 13, following the steps outlined at https://www.postgresql.org/docs/13/pgupgrade.html.
From an elevated command prompt, I'm running (under Windows 10):

SET PATH=%PATH%;C:\Program Files\PostgreSQL\13\bin;
pg_upgrade.exe --old-datadir &quot;E:\Programs\PostgreSQL\12\data&quot;
--new-datadir &quot;E:\Programs\PostgreSQL\13\data&quot; --old-bindir &quot;C:\Program Files\PostgreSQL\12\bin&quot; --new-bindir &quot;C:\Program
Files\PostgreSQL\13\bin&quot; --old-port=5431 --new-port=5432 --jobs=5

The directories appear to be all correct, however the command returns:

Performing Consistency Checks  
-----------------------------  
Checking cluster versions                                   ok  
  
*failure*  
Consult the last few lines of &quot;pg_upgrade_server_start.log&quot; or &quot;pg_upgrade_server.log&quot; for  
the probable cause of the failure.  
  
connection to database failed: could not connect to server: Connection refused (0x0000274D/10061)  
        Is the server running on host &quot;localhost&quot; (::1) and accepting  
        TCP/IP connections on port 5431?  
could not connect to server: Connection refused (0x0000274D/10061)  
        Is the server running on host &quot;localhost&quot; (127.0.0.1) and accepting  
        TCP/IP connections on port 5431?  
  
could not connect to source postmaster started with the command:  
&quot;C:/Program Files/PostgreSQL/12/bin/pg_ctl&quot; -w -l &quot;pg_upgrade_server.log&quot; -D &quot;E:/Programs/PostgreSQL/12/data&quot; -o &quot;-p 5431 -b &quot; start  
Failure, exiting  


pg_upgrade_server_start.log says:

command: &quot;C:/Program Files/PostgreSQL/12/bin/pg_ctl&quot; -w -l &quot;pg_upgrade_server.log&quot; -D &quot;E:/Programs/PostgreSQL/12/data&quot; -o &quot;-p 5431 -b &quot; start &gt;&gt; &quot;pg_upgrade_server_start.log&quot; 2&gt;&amp;1
The program &quot;postgres&quot; was found by &quot;C:/Program Files/PostgreSQL/12/bin/pg_ctl&quot;
but was not the same version as pg_ctl.
Check your installation.

I'm at a loss; what might be wrong, and how can I successfully perform this procedure?
The answer had to do with the option &quot;Beta: Use Unicode UTF-8 for worldwide language support&quot; being checked in my locale settings in Windows.
I disabled that option and restarted the computer, the upgrade went without issues after that.