Just ensure pins and width are exact same and the C and V rating such as 30V / 80C or 105C is either same or higher rated.
Any uncertainty please get in touch
When Replacing Cables Please Ensure No Power to System
AC / DC Power Unplugged any Batteries Removed