This would be a migration and an upgrade. For example,
https://docs.moodle.org/19/en/Moodle_migration and
https://docs.moodle.org/29/en/Upgrading, or the other way around. I favour migration first because then you'll have your original installation as a back-up. Note that going from 1.9 to 2 is rough. Many have given up and either transfered course-by-course,
https://docs.moodle.org/19/en/Course_backup resp.
https://docs.moodle.org/29/en/Course_restore, even more drastically, re-entered the courses manually. The latter have the advantage that you will make use of the new features of Moodle 2 - that is the reason why you upgrade, right?