I set up a Moodle platform, which should have the same content as an old Moodle platform which is running in another server. The old platform is version 1.9, the new one is in version 3.8.3. I want to keep the same users from the old platform, but I noticed that when I create users with the same password on both platforms, the hash of the passwords in the users' table is different.
It is important to point out that I tried with users with the same password but different data (username, email and so). I thought that both versions used MD5 hashing for the passwords. Both users' tables have exactly the same fields.
Is it possible to copy users from the old platform's database into the new platform's, while keeping compatibility? (That means, users being able to log in this new platform with their old credentials) If so, what considerations should I have?
Moodle has not used MD5 hashing for passwords for many years, due to it being insecure. Moodle uses the PHP function password_hash() - at the time of writing this uses bcrypt, but that may change with future versions of PHP.
Moodle should be able to detect that the password is using an old, insecure hashing algorithm and automatically update the hashed password when that user next logs in (after authenticating them against the old hash). See code here: https://github.com/moodle/moodle/blob/bbb7dfc62ea295099ad23e8a83497269c19ddcd1/lib/moodlelib.php#L4824
Your best best bet would, of course, be to set up a test copy of your Moodle 3.8 site, copy the user record from one of the existing accounts from your Moodle 1.9 site (that you know the password for) and try it out.
Note that this will not transfer data such as any custom profile fields, any user preferences, or, clearly, any user interactions, such as forum posts, assignment submissions, etc.