The first few lines of the file are the ones that have the database connection information.
$database_type = 'mysql';
$database_server = 'localhost';
$database_user = 'user';
$database_password = 'pass';
$database_connection_charset = 'utf8';
$database_connection_method = 'SET CHARACTER SET';
$dbase = '`database`';
$table_prefix = 'modx_';
The database_type and database_server are probably good as they are. The database_user, database_password and dbase (database name) will definitely need to be edited. The charset needs to match your database charset and collation; hopefully it is utf8. The table_prefix only needs to be edited if you used a different prefix.
Another solution is to do a new temporary installation in a subfolder, get that config.inc.php file and delete the subfolder.
And always, always do a full backup of database and files before doing anything major (or minor, for that matter) to your sites.