Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ChrisF79's avatar

Splitting my app between two servers

I have a real estate website and behind the scenes, the app is going out and downloading every picture for each listing, resizing to multiple sizes and uploading to S3 for storage. There are other CPU intensive tasks as well but that's the big one. It is really slowing my site down so I want to move the database and tasks to a different VPS. My question then is... Can I just git clone my site on the new server and then:

  1. Stop the cron on the first server and start it on the second
  2. Edit my .env to put the IP of the new server as the database host

Anything else? I'm sure there's something I'm missing that will mess something up. Any insight on what to expect or if I'm thinking correctly is highly appreciated!

0 likes
3 replies
bobbybouwmann's avatar

@chrisf79 Basically you can just create a mirror of your current server and stop the cron on one server and start it somewhere else.

However you're going to use a new database for the other application. How are you going to sync that data to the other server? Or is that not needed?

ChrisF79's avatar

Thanks Bobby! As for the database, it would live on the new server so the old server would have to access it remotely. That shouldn't be a problem, right?

bobbybouwmann's avatar

@chrisf79 In general it would be better to setup a separate database server as well. This way both applications can connect to one database server. It's also more secure and future proof ;)

Please or to participate in this conversation.