LAMP Staging Server with linux users
I need to have a mirror server of my production server so that I can test everything on that server first before implementing on production.
To mirror production server I need to copy current PHP code, uploaded files, database and linux machine users (as my PHP script need these accounts and home directories) from production server to new server and I also need to update all these from production server each time when I need to test anything on staging server because production server gets updated by the users.
I can update everything manually except Linux users and their home directories as they may affect the system. Is there any way to replicate a Linux machine users to another machine at the same time when they are created on production machine or is there any automated system they to staging.