How to upgrade elgg from version 4.3.8 to 5.x with composer?

I would like to upgrade my running network from version 4.3.8 to 5.x without loosing any data (yes, i have a backup)

Is it possible to overwrite the existing installation by using composer without any problems?

composer create-project elgg/starter-project:dev-master ./path/to/my/project
cd ./path/to/my/project
composer install
log in as admin

Is this the right way?

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.