Hi,
you must write the new IP to /etc/network/interfaces i think the simplest way is you Overwrite this file with the new Settings(i'm not shure that this work).
if your original config shows like this example:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.178.110
netmask 255.255.255.0
gateway 192.168.178.1
Then you must write all the data containig this file to the new file and only change the network settings.
after that you must start a shell command ( jshell library)
sudo /etc/init.d/network restart
to update the settings
But look out if you make here some errors you can't connect to the pi over the network.
regards
Andy