Thank to all that contributed to this topic, and a special note to @Zlash65.
This is how I solved the problem.
On my old server (running erpnext 10.1.81)
$ cd erpnext
$ bench backup
$ bench backup --with files
On the new server (runnng erpnext 12.x.x-develop)
$ cd erpnext
$ bench --force restore --with-public-files backups/20190228_173601-erp_mysite-files.tar --with-private-files backups/20190228_173601-erp_mysite-private-files.tar backups/20190228_173601-erp_mysite-database.sql.gz
$ bench start
On the new server (in a new tab, while bench was started in a previous tab)
$ bench --site erp.mysite migrate