Migration of database to new server

I have a postgres database that is beginning to outgrow its server. The database is 11 GB and running on a dedicated server with 8 GB RAM / 500 GB HD.

My host can provide a new server with 32 GB and 2 TB but it will be using a different IP address.

In my Xojo desktop app, I have hard coded the IP address into the program. Unfortunately, although upgrades are included, not everyone upgrades their software at the same time. Some users upgrade some computers when a new release is out but not every computer.

I have a DynDNS account and I was thinking of creating an alias to the database so that in the future, I just change the IP address of the alias if and when the server IP address changes - but it seems to me that this would add some overhead to accessing the database.

I could require that all users update prior to migrating the database and then have the user manually change to the new database IP address once the server is migrated. I would hate to have to make every user manually enter a new ip address on every one of their computers.

Once the server has been migrated to the new machine, the old server will be abandoned.

Not really sure what the best approach to moving to a new server would be.

Set your DNS TTL nice and low (< 5 minutes), migrate your DB then switch the DNS to the new IP.

The only issue you really have is kicking off the users from the current DB and making sure they haven’t performed a DNS lookup on your IP in the last 5 minutes (as it will be cached).

If you were really worried/cunning, you could proxy the traffic from the old IP to the new IP during the migration so connections to either IP would work. As you saw connections decrease to the old IP you decommission it.

Something like:

https://github.com/CrunchyData/crunchy-proxy

Never used it though.

Some test VMs on the lan should do the trick :slight_smile:

Fortunately, that wouldn’t be an issue since the businesses are all closed from Saturday afternoon until Monday morning.

If you don’t mind 15-30 minutes of downtime, the easiest way is to just do the DNS switch method.

You need to make the DNS alteration well in advance though to make sure the new low TTL is out there if your current TTL is high.

If you use Kaju, you could push it out as a required upgrade. Or if you use some other self-updater that supports that.

Another option is to try a connection to the old IP first, then to the new IP or old IP then new DNS.

So is the DynDNS option okay? I thought it would delay things too much.

Shouldn’t be any difference with Dyn.

OK. That’s good to know.

There are a few good options here. I will probably use a combination of them.

Just wanted to let you know that you were right. I modified the software to connect to the dyndns address instead of the hardcoded url and it connects without a hitch. This will be perfect. Once the new hardware is ready, all I need to do is change the url on dyndns and all the clients will be automatically connected to the new server.

Now I just have to make sure that all clients migrate to this newer software prior to making the switch.

Can’t they migrate you to a new machine and then just give you your old IP?

[quote=371271:@shao sean]Can’t they migrate you to a new machine and then just give you your old IP?

[/quote]
Nope. They told me they reassign the old IP address once I release the machine.

The Dyn method is actually better. I don’t have to rely on someone else to transfer the IP address. I just replace the IP address in Xojo with the dyn url and just change to the new ip once everything is migrated. The transfer occurs instantly as soon as I change the Dyn ip address.

Yeah, using a domain name is a better option, I was just thinking for the older clients that may not update…