You can do this from the Admin panel, it's described in the following post:
You need to go to Stores -> Configuration -> Advanced -> Admin -> Admin Base URL
Then enable "Use Custom Admin Path" and change the path.
Please back up important data before continuing.
Please, click on if you think my answer was helpful