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

Domas's avatar
Level 1

Staging server database

Hi,

I am searching for good practices and advice about the staging server database. Currently, all prod environment is hosted in AWS (Elastic beanstalk). My plan is to clone the existing Elastic beanstalk project and use it for staging. Maybe someone has an idea how to sync databases between production and staging environments? The main idea would be syncing not all tables (for example, exclude users table) and just tables which I need to be filled for testing. Maybe somebody has a different point of view and can share best practices for staging environments?

Thank you in advance for your advice and thoughts!

0 likes
1 reply
Nakov's avatar

I create factories to easily insert data into the staging database but I never sync the data to be as it is on production, that's unsafe + not syncing users as you are saying will break a lot of things IF you use foreign keys to the users table.

Staging VS Production in my opinion should match based on the codebase, not on the data inside. So the same version of the packages/language/database + same(copy) of the main branch used for production. The data can be completely your own. Having factories you can insert thousand of records easily too, which will make it close to production too if you have lots of data there.

Hope this helps :)

Please or to participate in this conversation.