Here is how:
Left-click the Dropbox icon from the system tray.
Then click on the account name and select Preferences.
Go To the Sync tab. The default path will be the Users\username folder. Click on Move.
Select a new location. It can be on a different drive or partition as needed. A new folder named Dropbox will be created inside the folder that will be selected for the new path.
Click OK to confirm the move.
Depending on the number of files and account size, it can take a while.
Once completed, the Dropbox folder will be available at the new location.
(You can also change the folder path for OneDrive in Windows, here’s how).
The steps are the same as those for Windows.
Left-click on the Dropbox icon from the panel. Then select Preferences.
Go to the Sync tab and click on Move.
Set a new path for the Dropbox folder and let the transfer to the new path complete.
From now on, the Dropbox files and folders will be stored and synced at the new location.