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

FounderStartup's avatar

Best way to maintain production database and code ?

Hey techies !

I am almost complete with my project and now need to upload the site on a production server. My queries are :

Q1 - What is the best way to maintain the code on the production server ? I am expecting lot of changes in the coming days so need to have a correct system at place. My understanding is that I will have a subdomain with the code ( it will use the live database ) . So for any changes I will first update the subdomain site and if correct then copy the changed files to live domain. Is this correct method ? Q2 - What is the best way to update a live database ? This is the scary part . How to update/change my live database for any changes like addition of fields ? Q3 - Which is the Best ftp for mac os. Does vscode have some reliable extension for this ?

0 likes
8 replies
Sinnbeck's avatar

If you really want to up your deployment skills, I suggest you learn git. It is a version control tool and makes it very easy to deploy changes to production, as it will track every single change to every single file. So you can always see when you changed what.

Regarding changing the database, you use migrations. https://laravel.com/docs/8.x/migrations

1 like
FounderStartup's avatar

@Sinnbeck

Github is one option. It means I update on GitHub, and then the code is updated on subdomain from GitHub repository and then after testing I update live domain from subdomain ? Is this what you are suggesting ? I think cpanel has started some functionality with GitHub now ?

Sinnbeck's avatar

@FounderStartup Checking it on a subdomain is called staging. If this is your first time, then maybe checking it locally on your machine will be ok. You should be able to test everything locally assuming it has the same setup as production.

Be aware that github isnt the same as git

  • git = program to manage version of files
  • github = a repository for storing files that are managed by the git program
1 like
FounderStartup's avatar

@Sinnbeck Not exactly. I have few sites running , but they were developed by freelancers. This is my first site developed by me and will be maintained by me , so need to follow the best procedure.

Anyway thanks for your suggestions.

Snapey's avatar

@FounderStartup one key point is to always update your site via a script ( eg bash) so that it's not down to you to remember certain steps

If you are manually copying files between servers then you are definitely doing it wrong

my process is (simplified) commit changes to git, login to the server, run a command that clones the latest commit into a new folder, run composer install in that new folder, run any migrations, swap a symlink from the old folder to the new folder

On most sites, the above is a single command and takes typically less than 5 seconds

( or automate through ploi.io or forge)

1 like
FounderStartup's avatar

@Sinnbeck

I checked ploi.io. Seems to be good. But is it an alternative of whm/cpanel ? Do I need cpanel also with plio.io ?

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@FounderStartup It does not have cpanel. You can see it as an alternative to cpanel.

It requires you to have a subscription with one of its supported server providers. It will then create a server from scratch for you and set everything up (install php, nginx and mysql).

https://ploi.io/server-installation

https://ploi.io/links

I have used both digital ocean and hetzner to provision servers, but they do support others as well

1 like

Please or to participate in this conversation.