How to change the IP address of a server running on a Pi

Hey there everyone, basically as the title says, I moved recently and need to change the server IP address, but dont want to wipe the pi and lose everything thats on there, many gigs of data Id like to keep and not have to reupload and all.

Ive tried to change the IPs in the:
/etc/nginx/sites-available/default

Also changed a couple IPs in the: /var/www/owncloud/config/config.php

Changing those IP addresses hasn't worked, I havent tried much of anything else because I cant find my issue anywhere. When i try to type in its local ip address into my browser: "192.168.1.x" it redirects it to its old IP address and says it can not be reached. I have no clue as to why it is redirecting, this router has never been associated with that IP.

I am also totally new to this! Thanks!

Hi,

Hasnt seemed to work yet

sorry this sentence contains zero information what issues you're facing when doing the changes you have posted.

fixed it, hopefully thats better

"Nothing worked" is even worse

please explain what you mean, I changed the IPs in the files, they havent worked, I said above that what I did already

Just can point you to:

http://www.catb.org/esr/faqs/smart-questions.html#beprecise

Hows that? I gave as much detail as I can.

You havn't provided anything describing your problem. Needed infos are:

  • What do you think should happen when changing these files
  • What "didn't work" when changing these

Edit Ok, your third edit is better now

1 Like

So, the only thing what could cause such a redirect within oC itself is the trusted_domains setting in your /config/config.php which needs to include your new IP Address.

Any other redirect is probably happening within your router or in a webserver config you haven't found yet.