one of my clients asked me to do the following job:
- the client is a doctor who purchased my system for doctors and happy with it (but it is locally on his network only)
- i had an online version of that system and he like it as well
- but needed a way to make working on any of them would be feasible
so what i did is like that
- i created a script with python that logs into both servers and check which of them has recent use
- i used another script to detect a number which tells which server has the heist value then it is the server with more updates
- then i copy from that server to the other (syncing) all static files and media files and the project files
- lastly i create a back up of the database and copy it to the other server and do a restore there to catch every thing
i have done it with python using three libraries only and it works really well, and runs automatically one at night every day