Personally, if using the rename tool for this job, I would use the "Find and Replace" area at the bottom, in "Update to point to new location" mode (top dropdown).
Find What: G:\
Replace With: M:\
However, the OP is not 100% clear.
If you need to update existing library entries to point them to a new drive letter, then the above is the way to go. Select all affected files before pressing F6, pay attention to the before/after columns to be sure you're happy before proceeding.
If you also need to update where auto-import is looking for files, go to "Tools > Library and Folders > Configure Auto import"