Update

Update Magento 2 using the command-line:

cd /path/to/project
php bin/magento maintenance:enable

# Get new version + update packages
composer require magento/product-community-edition=2.3.1 --no-update
composer update

# Clear cache + generated files
php bin/magento cache:clean
rm -rf ./var/cache/*
rm -rf ./var/page_cache/*
rm -rf ./generated/code/*

# Update database schema + data
php bin/magento setup:upgrade
php bin/magento maintenance:disable

Reference